PHP _POST vars returning with wrong key
Posted: Mon Apr 09, 2012 5:06 am
When i post a form and retrieve the $_POST data, one of the keys is wrong
a var_dump of $_POST returns this
As you will note, there is no 'pwc' field in my form. Why is it getting 'pwc' instead of 'passwordc'
This has really baffled me, it's never happened before.
Code: Select all
<form name="input" action="" method="post" >
<label for="email">Email</label><input type='email' name='email' id='email' />
<span id='email_error'>
<? if(isset($signup_errors)){if(array_key_exists('email',$signup_errors)){echo $signup_errors[email];}}?>
</span>
<br />
<label for="password">Password</label><input type='password' name='password' id='password' />
<span id='password_error'>
<? if(isset($signup_errors)){if(array_key_exists('password',$signup_errors)){echo $signup_errors[password];}}?>
</span>
<br />
<label for="passwordc">Confirm</label><input type='password' name='passwordc' id='passwordc' />
<span id='passwordc_error'>
<? if(isset($signup_errors)){if(array_key_exists('passwordc',$signup_errors)){echo $signup_errors[passwordc];}}?>
</span>
<br />
<input type='submit' id='submitform' name='s5' value='submit4' />
</form> Code: Select all
array(3) { ["email"]=> string(13) "test@test.com" ["password"]=> string(9) "testingpw" ["pwc"]=> string(9) "testingpw" }This has really baffled me, it's never happened before.