tommie Posted September 22, 2006 Share Posted September 22, 2006 Hi.I have a problem i just upgraded to php5 and now my pages dont work.i have always used register global=on. I know that the security sucks with that but i really dont care use it bc its so easy. but now when try my pages it they dont work. when i call a variable from a form from the page before i use $variable and not $get['variable'] and i dont wanna change every page. How can i make it works again?and of course i have register glocal=on in php.ini Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/ Share on other sites More sharing options...
ober Posted September 22, 2006 Share Posted September 22, 2006 Well, it's $_GET['varname'], first of all. Secondly, you really need to change all your pages to reflect this. If you don't it's just poor coding and insecure.Also, if you've made the change, make sure you restart your webserver. Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96671 Share on other sites More sharing options...
tommie Posted September 22, 2006 Author Share Posted September 22, 2006 ok but if i wanna have poor coding and very unsecure page how can i make it to work agian. plzz help me i have like 500pages dont wanna change them all. Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96711 Share on other sites More sharing options...
ober Posted September 22, 2006 Share Posted September 22, 2006 .... you have made no indication that you restarted the webserver after you made the php.ini change. Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96715 Share on other sites More sharing options...
tommie Posted September 22, 2006 Author Share Posted September 22, 2006 ok sorry i did restart my server and my computer very many times after i chaged php.ini :)i am a noob but not so much lol :) Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96718 Share on other sites More sharing options...
ober Posted September 22, 2006 Share Posted September 22, 2006 Ok, well that's pretty much all that controls register_globals... so if that didn't fix it, I'm not sure what the issue is.What webserver are you using? And what PHP version exactly? Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96721 Share on other sites More sharing options...
tommie Posted September 22, 2006 Author Share Posted September 22, 2006 im using the latest version of xampp so:Apache 2.2.3 PHP 5.1.6when i used it before dont remember what version i used then it was only to turn on registerglobal and restarted the server and it worked so im kinda bummed now..:/ Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96723 Share on other sites More sharing options...
wildteen88 Posted September 22, 2006 Share Posted September 22, 2006 You can still use the superglobals, eg _GET, _POST, _SESSION etc, when regsiter globals is enabled. Also make sure you are edting correct the php.ini that is located in /opt/lampp/etc/ (linux) or xampp\apache\conf (windows)And make sure you are editing the value of register_gloabls in the correct place too in the php.ini. Make sure you are not editing anything that is after any semi-colons (;). To change the value of register globals find the following:[code]; to possible security problems, if the code is not very well thought of.[/code]That is around line 456, However this maybe different for you. After that is where you change the register_gloabls setting. Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96825 Share on other sites More sharing options...
tommie Posted September 22, 2006 Author Share Posted September 22, 2006 ok.. cant find a php.ini in xampp\apache\conf but in xampp\apache\bin is 1 and that one was register global=on and in apache\php every php.ini is register global=on even the php5.ini so im kinda confused that its not working...:/ Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96844 Share on other sites More sharing options...
tommie Posted September 22, 2006 Author Share Posted September 22, 2006 i even changed to php4 and it didnt work dammit i dont know what to do anymore..:( Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96846 Share on other sites More sharing options...
wildteen88 Posted September 22, 2006 Share Posted September 22, 2006 Add an empty .htaccess file into the root of the htdocs folder, or whatever folder you use to store your php script. Now add the following into the .htaccess file:[code]php_flag register_globals On[/code]Does youre script work now?Also run the function phpinof() and see if register_globals is enabled under the Master Value. if its and your script doesnt work still then there is a problem with your script. Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96851 Share on other sites More sharing options...
kenrbnsn Posted September 22, 2006 Share Posted September 22, 2006 xampp comes with register_globals enabled by default. If you disable it, their demo scripts stop working unless you modify them. I disabled register_globals and modified the demo scripts on my laptop.The php.ini file on the laptop is in C:\Program Files\xampp\apache\bin\php.iniKen Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96865 Share on other sites More sharing options...
imartin Posted September 22, 2006 Share Posted September 22, 2006 When you say "my pages dont work" you have to be more specific. What exactly is the problem? because register globals off wasn't the only change in PHP.What error are you getting? Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96866 Share on other sites More sharing options...
tommie Posted September 22, 2006 Author Share Posted September 22, 2006 ok when i run the phpinfo i got register global=off so thats my problem i just havnt changed the right php.ini but i cant find anymore lol but how exactly do i do a htaccess file i tried and created a test.htaccess and wrote [code]php_flag register_globals On [/code] but nothing changed. so dont i have to implement it or something? Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96870 Share on other sites More sharing options...
tommie Posted September 22, 2006 Author Share Posted September 22, 2006 ok now i have found the right php.ini and changed so now phpinfo() says that register_global=on but i still cant use my scripts..page1:[code]<form action=index2.php method=post><input type=text name=variable><input type=submit value="Logga In"></form>[/code]page2[code]<?echo $variable;?>[/code]i cant find any errors in that code and it have always worked before Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96890 Share on other sites More sharing options...
imartin Posted September 22, 2006 Share Posted September 22, 2006 Does index2.php return any PHP errors? Do you have error reporting turned off? Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-96943 Share on other sites More sharing options...
wildteen88 Posted September 23, 2006 Share Posted September 23, 2006 [quote author=tommie link=topic=109057.msg439552#msg439552 date=1158948273]ok when i run the phpinfo i got register global=off so thats my problem i just havnt changed the right php.ini but i cant find anymore lol but how exactly do i do a htaccess file i tried and created a test.htaccess and wrote [code]php_flag register_globals On [/code] but nothing changed. so dont i have to implement it or something?[/quote]Sorry I should of explained how to create a htaccess file. The htaccess file has no name, it is just a file extension on its own. To create the htaccess file open up Notepad and type the following in to a new file:php_flag register_globals On Now go to [b]File > Save As...[/b] type the following exactly into the Filename box [b]".htaccess"[/b] including the quotes. Click save. The htaccess file has now been created. Now move the htaccess file to the htdocs folder (xampp/htdocs/). Quote Link to comment https://forums.phpfreaks.com/topic/21653-registerglobalon/#findComment-97202 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.