Notes, tests, directions, instructions...
Anything that could be useful once more (to someone)...

 
Search:


PHP » PHP register_globals

Scripts do not work with register_globals off?

Have you got ancient PHP scripts that do not work with register_globals off? As register_globals become deprecated as of 5.3.0 and removed os of 5.4.0, you would (finally :-)) have to rewrite all your scripts relying on register_globals=on. Well if you have some ancient systems written in PHP where complex rewriting would be hell of a work (and time), you may just add this line at the beginning of each PHP script that e.g. receives form-variables:

extract($_REQUEST);

Important thing to mention: This is dangerous, as well as the register_globals=on! However, I do not see anything wrong when using it e.g. on systems that are not available to public and save my time to rewrite hundreds of scripts.

---

Just to remind, the correct way would be for each variable:
$variablename=$_POST["variablename"]; #from POST
or
$variablename=$_GET["variablename"]; #from GET
or
$variablename=$_REQUEST["variablename"]; #from both

WEBEDITOR DOMÉNY s.r.o.