title: php form not posting to self
body: <p>I have a simple dropdown menu which posts the result to itself but when i choose one of the options in the drop down menu it does not echo back the result as expected.</p>
  
  <p>I'm sure i've just missed out something simple but can't spot it. Any ideas? The form posts but does not echo back $user_settings.</p>
  
  <pre><code>&lt;?php
  include "functions.php";
  connect();
  
  $sql="SELECT user_id, user_realname FROM users ORDER BY user_realname ASC";
      $result=mysql_query($sql);
  
      while ($row = mysql_fetch_array($result)) {
          $name=$row['user_realname'];
          $options.="&lt;OPTION VALUE=&gt;".$name.'&lt;/option&gt;';
          }
  
  if(isset($_POST['submit'])){
      $user_realname = $_POST['username_select'];
      $user_select = mysql_query("SELECT user_id, user_realname FROM users WHERE user_realname = '$user_realname'")
      or die ("Could not get user data");
  
      while($row = mysql_fetch_array($user_select)){
  
          $user_settings = $row['user_id'];
          echo $user_settings;
      }
  }
  ?&gt;
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;body&gt;
              &lt;form action="&lt;?php echo $PHP_SELF;?&gt;" method="POST"&gt;
                  &lt;tr&gt;&lt;label&gt;Choose User to Edit&lt;/tr&gt;
                  &lt;tr&gt;&lt;SELECT NAME="username_select"&gt;&lt;OPTION VALUE=""&gt;&lt;/option&gt;User's Name&lt;?php echo $options;?&gt;&lt;/SELECT&gt;&lt;/label&gt;&lt;/tr&gt;
                  &lt;tr&gt;&lt;input type="submit" value="submit" name="submit"&gt;&lt;/tr&gt;
              &lt;/form&gt;
              &lt;?php echo $user_settings;?&gt;
              &lt;br/&gt;
              &lt;a href="admin.php"&gt;Go Back&lt;/a&gt;
          &lt;/body&gt;
      &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>