just a side note to the above you will need to add the ?
example
$page=$PHP_SELF."?".$_SERVER['QUERY_STRING'];
just a side note to the above you will need to add the ?
example
$page=$PHP_SELF."?".$_SERVER['QUERY_STRING'];
Following method do not show the URL in user browser (as the author claimed) if the code resides in the source page of FRAME or IFRAME (say SRC="sourcepage.php") . In that case the URL of the SOURCE page is displayed.
$url = sprintf("%s%s%s","http://",$HTTP_HOST,$REQUEST_URI);
echo "$url";
Expected result: http://localhost/urltest/framedpage.php
Actual result: http://localhost/urltest/sourcepage.php
Note that $_SERVER["HTTP_REFERER"] may not include GET data that was included in the referring address, depending on the browser. So if you rely on GET variables to generate a page, it's not a good idea to use HTTP_REFERER to smoothly "bounce" someone back to the page he/she came from.