You need to access it through the $SERVER superglobal array -
$SERVER['QUERY_STRING']
This is because with recent versions of PHP the default for register_globals is off (Yippeee!!!).
If you want to code with globals you need to change this in the php.ini but I would advise against it as it is much better coding practice not to use them.