nawad24 Posted September 11, 2007 Share Posted September 11, 2007 we just found out that our web hosts turned off the register globals on their servers and that is the reason our site has stopped functioning. they said we need to also turn it off on our end. i have no idea how to do this (we are a non profit and don't have someone on site to do this.) can anyone provide a quick tutorial or point me in the right direction? thanks! Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 11, 2007 Share Posted September 11, 2007 do they mean turn it off or stop using code that relies on it being turned on? If your app stopped working because they turned off register globals, it seems apparent that you don't need to turn off anything. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 11, 2007 Share Posted September 11, 2007 You need to rewrite the code so it doesn't rely on it. You can't turn it off in your code, it will require a lot of work to rewrite depending on how big the site is. Quote Link to comment Share on other sites More sharing options...
nawad24 Posted September 11, 2007 Author Share Posted September 11, 2007 we need to turn it off to where it was pointing. thanks! Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 11, 2007 Share Posted September 11, 2007 That doesn't make any sense. Do you know what register globals means? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted September 11, 2007 Share Posted September 11, 2007 I assume by "turn if off your end" they meant that you need to make your code compatible with the settting off. If they are hosting your website and have turned off the setting then there is nothing to "turn off". If you have no real interest in security, and really just want a fix to make the site work, then adding the following bit of code to the top of your scripts should sort it out for you: <?php extract($_POST); extract($_GET); extract($_SERVER); extract($_SESSION); extract($_COOKIE); ?> If you'd rather fix the code properly, i suggest you read up a little about the register_globals setting. Here would be a good place to start: http://uk.php.net/register_globals If you do intend to retrieve the variables from their respective superglobal arrays, e.g.: <?php $var = $_POST['var']; ?> Then it may be advantageous to add in this piece of code: error_reporting(E_ALL); To the top of your php files. This will make sure you receive notices for undefined variables - which is what all of the variables that are being used without being retrieved from their respective arrays will be. However, (and hence the underling of the may) it could be that the code was not written particularly well, and you'll run into other notices which may confuse the issue whilst not affecting the running of the script. I hope some of that helps. Quote Link to comment Share on other sites More sharing options...
nawad24 Posted September 11, 2007 Author Share Posted September 11, 2007 do i create a php.ini file and then add in this code? thanks - this is all new to me! Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted September 11, 2007 Share Posted September 11, 2007 you will need a PHP developer to go through your code and update places that rely on register globals. There is no magic "add this to a file" or "turn this on or off." This could be considerable work. 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.