php $_POST var clearing itself when i check it
<p>i have a crazy problem that i just can't figure out. my form has two fields and a submit button. when i submit the vars get passed into $_POST just fine...</p>

<pre><code>print('&lt;div class=error&gt;');
print_r($_POST);
print('&lt;/div&gt;');
</code></pre>

<p>that gives me the two fields with the expected values along with the value of the submit button.</p>

<p>HOWEVER! when i add the following line of code so i can process based on the submit button, it clears all of the data. the post array shows up empty. </p>

<pre><code>if ($_POST['submit'] == 'Submit') {
</code></pre>

<p>that clears the data. if i change the value from 'Submit' to anything else, the vars still show up in $_POST, they just get cleared when i try to check them. </p>

<p>any ideas what i'm doing wrong here?</p>

<p>here's the form:</p>

<pre><code>&lt;form method="post" action="&lt;?php echo $_SERVER['PHP_SELF'];?&gt;"&gt;
&lt;?
  if (isset($msg)) {
    echo "$msg";
  }
?&gt;
&lt;input type=text  name='email'&gt;&lt;br&gt;
&lt;br&gt;&lt;input type=password name='password'&gt;
&lt;br&gt;
&lt;input type="submit" name="submit" value=Submit&gt;
&lt;/form&gt;
</code></pre>

<p>and here's the processing code:</p>

<pre><code>if ($_POST['submit'] == 'Submit') {
echo "&lt;div class=error&gt;made it here&lt;/div&gt;";
$u = $_POST['email'];
$p = $_POST['password'];
$auth = mysql_query("Select * from member where email='$u' and password='$p'");
$auth = mysql_fetch_array($auth);

if ($auth) {
    $pid = $auth[id];

    echo "aa";
    sess_register("sess_msg");
    $sess_msg = null;
    global $auth, $pid;
}
}
</code></pre>

<p>if i change the value when i check to see if the submit button has a value to something other than the actual value of the submit button, which is 'Submit' - it clears all variables sent to $_POST</p>
