I have a client who has an online shop he would like me to host. The site was written by another develop and uses register globals.
When I uploaded it to my server it told me it required register_globals to be enabled, I checked the .htaccess file and it was. When I asked the hosting company they told me it had been dreprecated and wouldn't run on the server. I'm not sure what parts of the code are dependant on it as I've not looked into the progamming too closely, I was only intending to host it.
Is there a quick fix or am I going to have to take the code apart and fix it with up to date alternatives?
A real ugly but very quick fix is something like the following:
foreach (array('_GET', '_POST', '_COOKIE', '_SERVER') as $_SG) {
foreach ($$_SG as $_SGK => $_SGV) {
$$_SGK = $_SGV;
}
}
Preferably at the top of any php script that can be executed, BEFORE any other code.
Please note, that this is not something I would really recommend. Please try to persuade your client(s) that they should get something better. If code requires register_globals, chances are that it's as insecure as hell...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With