Given this example url:
http://www.example.com/some-dir/yourpage.php?q=bogus&n=10
$_SERVER['REQUEST_URI']
will give you:
/some-dir/yourpage.php?q=bogus&n=10
Whereas $_GET['q']
will give you:
bogus
In other words, $_SERVER['REQUEST_URI']
will hold the full request path including the querystring. And $_GET['q']
will give you the value of parameter q
in the querystring.