I'm using basename($_SERVER['PHP_SELF'])
but this only gives me the page name e.g.
http://www.mysite.com/helloworld.php?name=Dan
I can only get "helloworld.php".
I need "helloworld.php?name=Dan"
I'm using basename($_SERVER['PHP_SELF'])
but this only gives me the page name e.g.
http://www.mysite.com/helloworld.php?name=Dan
I can only get "helloworld.php".
I need "helloworld.php?name=Dan"
There is also $_SERVER['QUERY_STRING']
, and $_SERVER['REQUEST_URI']
and many more.
In your case, you can get it like:
$whatiwant = $_SERVER['REQUEST_URI'];
or
$whatiwant = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];