title: Anomaly with a input with C++ CGI script
body: <p>i'm working on a CGI script which will authorise a person on a server.
  i am writing this on a C++ using CGI provided by Ubuntu's apache2 server.</p>
  
  <p>However, i have encountered a strange anomaly which i cannot understand.</p>
  
  <p>The case is the following:
  As you know, when i have a HTML like:</p>
  
  <pre><code>&lt;form method = "post" action = "./cgi-bin/main.cgi?a=auth"&gt;
      u: &lt;input type = "text" name = "u" value = "Alfred Bot"&gt; &lt;br&gt;
      p: &lt;input type = "password" name = "p" value = "alfred"&gt; &lt;br&gt;
      &lt;input type = "submit" value = "Accept"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This will recall a main.cgi program with a "u=Alfred+Bot&amp;p=alfred" on the input.
  However, in my case this is false.</p>
  
  <p>CASE 1: NO MEMORIZING</p>
  
  <pre><code>string s;
  while (!cin.eof()) {
      cin &gt;&gt; s;
      cerr &lt;&lt; s &lt;&lt; "\n";
  }
  </code></pre>
  
  <p>In this case, log file will contain a needed line "u=Alfred+Bot&amp;p=alfred".</p>
  
  <p>CASE 2: SAVING THE DATA</p>
  
  <pre><code>while (!cin.eof()) {
      cin &gt;&gt; s;
      cerr &lt;&lt; s &lt;&lt; "\n";
      form_output += string(s);
  }
  cerr &lt;&lt; "\"" &lt;&lt; form_output &lt;&lt; "\".\n";
  </code></pre>
  
  <p>In this case, log file will contain an EMPTY LINE either in cycle and beyond.</p>
  
  <hr>
  
  <p>I have tried various other methods including stringstreams and scanf read, but result stays the same: whenever i try to memorize the input, it is null and void.</p>
  
  <p>Thanks for any suggestions,
  marqueewinq </p>