title: How to get the value of a textbox on the same page in PHP
body: <p>Here is my code:</p>
  
  <pre><code>&lt;form action="" method="get" &gt;
      &lt;input type="text" name="un"&gt; 
      &lt;input type="password" name="un2" /&gt;
      &lt;input type="submit" value="submit" name="submit" /&gt;
  &lt;/form&gt;
  
  &lt;?php 
      $users1 = $_GET["un"];
      $id     = $_GET["un2"];
      echo $users1;
  ?&gt;
  </code></pre>
  
  <p>I am unable to display it through this way</p>
  
  <p>error:</p>
  
  <pre><code>Notice: Undefined index: un in C:\wamp\www\vas1\register1.php on line 31
  </code></pre>
  
  <p>line 31:</p>
  
  <pre><code>$users1 = $_GET["un"];
  </code></pre>