|
-
October 18th, 2006, 12:18 AM
#1
get complete url
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.
-
October 18th, 2006, 12:52 AM
#2
Re: get complete url
maybe you could add thid
Code:
echo $_ENV['REQUEST_URI'];
-
October 18th, 2006, 12:59 AM
#3
Re: get complete url
Thank you for your reply. Unfortunatelly it didn't work (I got an empty string).
EDIT: Well...I guess I am stuck using
Code:
foreach($_GET as $key=>$val)
{
...
}
Last edited by EoF; October 18th, 2006 at 01:04 AM.
-
October 18th, 2006, 02:32 AM
#4
Re: get complete url
oops sorry..
maybe because i am using the phptriad under windows.
the solution is the same ... take the environment URI
just a bit change :
Code:
// echo $_ENV['REQUEST_URI']; change into below
echo "THE URI IS " . getenv('REQUEST_URI');
simple code to try this i have put in
http://ngetrend.com/code/URISample.php
-
October 18th, 2006, 05:49 AM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|