Problem accessing $_POST data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iG9
Forum Commoner
Posts: 38
Joined: Fri Jul 18, 2008 2:11 pm

Problem accessing $_POST data

Post 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:
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Problem accessing $_POST data

Post by requinix »

Did you actually name the form fields with the $ sign?
iG9
Forum Commoner
Posts: 38
Joined: Fri Jul 18, 2008 2:11 pm

Re: Problem accessing $_POST data

Post by iG9 »

Wow, I feel like a retard. Too long in front of the keyboard I guess. Thanks man. :mrgreen:
Post Reply