$var instead of $_GET['var'] in PHP?

php

Solution

I think you mean Register Globals.

You shouldn’t use them because you cannot distinguish the source of that variable values since they can come from any source of the EGPCS variables (Environment, GET, POST, Cookie, Server).

So if you have a the `$var`, you cannot say if the value is either from `$_ENV['var']`, `$_GET['var']`, `$_POST['var']`, `$_COOKIE['var']` or `$_SERVER['var']`.

Problem

Ok I cannot remember the details on this but on some servers you can use $var instead of $_GET['var'] to access a variable in the URL, I know this is BAD but I can't remember why it is bad?

Original source

Related problems