Hello,
how can I obtain the full url in PHP? I need the entire string that's in the address bar, including the GET variables (if any)? I have tried $_SERVER['PHP_SELF'] but that only gives me the webpage.
Printable View
Hello,
how can I obtain the full url in PHP? I need the entire string that's in the address bar, including the GET variables (if any)? I have tried $_SERVER['PHP_SELF'] but that only gives me the webpage.
maybe you could add thid
Code:echo $_ENV['REQUEST_URI'];
Thank you for your reply. Unfortunatelly it didn't work (I got an empty string).
EDIT: Well...I guess I am stuck usingCode:foreach($_GET as $key=>$val)
{
...
}
oops sorry..
maybe because i am using the phptriad under windows.
the solution is the same ... take the environment URI
just a bit change :
simple code to try this i have put inCode:// echo $_ENV['REQUEST_URI']; change into below
echo "THE URI IS " . getenv('REQUEST_URI');
http://ngetrend.com/code/URISample.php
Thank you, that did it!