aaron4osu — 2012-10-18T08:15:15-04:00 — #1
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?
cpradio — 2012-10-18T08:17:26-04:00 — #2
Is your form using GET or POST for its submission? As you may want to check $GET['requestername'] or $REQUEST['requestername']
aaron4osu — 2012-10-18T08:30:34-04:00 — #3
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']
starlion — 2012-10-18T08:33:19-04:00 — #4
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)
aaron4osu — 2012-10-18T08:58:16-04:00 — #5
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
cups — 2012-10-18T10:24:36-04:00 — #6
... and restarting the server.