EmperorJazzy Posted July 3, 2007 Share Posted July 3, 2007 Hi All, I've recently begun programming PHP again and have found my old code doesn't work anymore. It's been a few years since my code was written, and simple functions don't seem to be working. I've done a bit of research into the syntax again and found the following; I used to use a function as such; if ($REQUEST_METHOD=="POST") { Now I've seen alot of the syntax is if ($_SERVER($REQUEST_METHOD=="POST")) { And referencing variables from the form is as such; $_POST['variable'] Where previously I could reference them in the simple form; $variable Has there been a language syntax change that would cause my old code to be obsolete? Is there a configuration line that could be changed to allow this old code to work? Your assistance would be greatly appreciated! I'm going mad I tell you! Regards, Jazzy P.S Same ISP, Different Version of PHP Quote Link to comment Share on other sites More sharing options...
Barand Posted July 3, 2007 Share Posted July 3, 2007 Not a syntax change but "register_globals" was usually ON but was discovered to be a gaping security hole and is now OFF by default. You need to reference the $_GET, $_POST, $_SERVER arrays etc explicitly to read the values. Quote Link to comment Share on other sites More sharing options...
EmperorJazzy Posted July 3, 2007 Author Share Posted July 3, 2007 Thanks Barand.. is there any reference material you could guide me to to understand the security issues, and thus if it's worth requesting the ISP switch Register_Globals back on? Or of course, you opinion on switching Register_Globals back on? Quote Link to comment Share on other sites More sharing options...
Barand Posted July 3, 2007 Share Posted July 3, 2007 http://us2.php.net/register_globals I doubt you ISP would be willing to turn it back on again, for good reason. A quick and dirty workaround is extract() but that just removes the lid from the hole. eg extract($_POST) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.