title: PHP: Echoing an input submitted from a form
body: <p>I have a form which contains one text field. Now, I'm trying to echo out the contents of that input after the form was submitted. Here's my code for the same:</p>
  
  <pre><code>&lt;script&gt;    
      function postResultss()
      {
          document.write("&lt;?php echo ($_POST['tweet1']); ?&gt;");
      }
  &lt;/script&gt;
  
  &lt;form method = "POST"&gt;
      &lt;input type = "text" name = "tweet1"&gt;
      &lt;br&gt;
      &lt;input type = "submit" onclick = "postResultss()" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The above code is inside a PHP file. However, nothing gets echoed out on submitting the form. The function does get called as expected, because I have tried echoing custom messages while debugging. However, nothing gets echoed out when I try to echo the value of <code>$_POST['tweet1']</code>, where <code>tweet1</code> is the name of the input text field whose contents I'm trying to display.</p>
  
  <p>What seems to be wrong here?</p>