what is the difference between $_SERVER['REQUEST_URI'] and $_GET['q'] (which is used in Drupal)?
$_SERVER['REQUEST_URI']
$_GET['q']
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.
q
2.1m questions
2.1m answers
60 comments
57.0k users