I've been making changes to a form I've been working on. I added the jquery-validation plugin for client side validation. Now my $_POST array is empty when it gets to my php script. I was messing around with echo statements and found that if I just used $ plus the field name from the form it has the value.
echo 'requester_name: '. $_POST['requester_name'] ."<br />";
echo 'requester_name: '.$requester_name."<br />";
The first is blank and the next one somehow has the value...
Have I just not had enough caffeine yet this morning? What is happening here?
Is your form using GET or POST for its submission? As you may want to check $GET['requestername'] or $REQUEST['requestername']
yes both of those worked. thanks that helped me find it. In my copy and paste madness the method='post' must have got deleted. But i'm still surprised that just having $ plus the input name had a value stored in it with out having to do something like $requester_name =$POST['requestername'] or $requester_name =$Request['requestername']
That would indicate register_globals is on, which is highly discouraged. (In fact, it's so highly discouraged that this ability was removed from PHP entirely as of PHP 5.4.0)
Good to know Thanks. For anyone else that needs to know you can turn register globals off by just changing:
register_globals = On
register_globals = Off
in the php.ini file located in my home directory
... and restarting the server.
This topic is now closed. New replies are no longer allowed.