Page 1 of 1

Problem accessing $_POST data

Posted: Wed Mar 25, 2009 4:09 pm
by iG9
Ok, bizzare little issue (at least to me)...
I'm writing a script to let users change their passwords. New passwords are submitted via post.

Code: Select all

print_r($_POST]);
gives the following:
Array ( [$newPassword] => fakepassword [$newPassword2] => fakepassword )

yet

Code: Select all

echo '<br />'.$_POST[newPassword];
on the following line echos not a thing. also tried

Code: Select all

echo '<br />'.$_POST['newPassword'];
This strikes me as odd, because I'm doing the exact same thing a few lines up with $_GET and it works fine. Also, extract() works on the get but not the post. This is really baffling to me. Any help is much appreciated. :banghead:

Re: Problem accessing $_POST data

Posted: Wed Mar 25, 2009 4:10 pm
by requinix
Did you actually name the form fields with the $ sign?

Re: Problem accessing $_POST data

Posted: Wed Mar 25, 2009 4:40 pm
by iG9
Wow, I feel like a retard. Too long in front of the keyboard I guess. Thanks man. :mrgreen: