My webhosts will soon be turning Register Globals off. What I wanted to know is will the code work for sessions as well as posting variables from a form.
<? extract($GET); extract($POST); ?>
Thank You
As it is, no. You would need to extract the session vars also. But you'll want to extract in the same variables order as set in php.ini.
what like this?
extract($GET); extract($POST); extract($_COOKIE);
Checked the order so I presume COOKIE is used for sessions?
$_SESSION is used for sessions, but you'll probably also want cookie.
Doh stupid me of course. Bit of a bitch having register_globals being turned off but at least it is making php secure and also teaching me safer practices, if of course what I am doing is safe lol.
Thank you for your help.
what your doing is negating the safety benefit of turning register globals off.
your essentially turning it back on.
you still forgot _SERVER