Use $_POST to get input values on the same page
<p>Sorry if this is a rather basic question.</p>

<p>I have a page with an HTML form. The code looks like this:</p>

<pre><code>&lt;form action="submit.php" method="post"&gt;
  Example value: &lt;input name="example" type="text" /&gt;
  Example value 2: &lt;input name="example2" type="text" /&gt;
  &lt;input type="submit" /&gt;
&lt;/form&gt;
</code></pre>

<p>Then in my file <code>submit.php</code>, I have the following:</p>

<pre><code>&lt;?php
  $example = $_POST['example'];
  $example2 = $_POST['example2'];
  echo $example . " " . $example2;
?&gt;
</code></pre>

<p>However, I want to eliminate the use of the external file. I want the $_POST variables on the same page. How would I do this?</p>
