Page 1 of 1

PHP variable, current page with parameters

Posted: Fri Jan 27, 2012 4:20 pm
by Slason
Is there a variable that contains the current page with parameters?

For example, the

Code: Select all

$_SERVER['PHP_SELF'];
only contains the current page, but I would like it to contain the current URL parameters as well. In this instance I want it to contain "?id=1" as well, but to use something like

Code: Select all

$_SERVER['PHP_SELF']."?doChangePass=true&id=1"
is not what I want, since there are different paramters at different times.

Re: PHP variable, current page with parameters

Posted: Fri Jan 27, 2012 4:39 pm
by social_experiment
$_SERVER['QUERY_STRING'] contains the query string in the url; have a look at this url for more information
http://www.php.net/manual/en/reserved.v ... server.php

Re: PHP variable, current page with parameters

Posted: Fri Jan 27, 2012 4:55 pm
by Slason
Thx for a quick reply. Works perfectly now.