Kyleva2204
06-07-2005, 04:59 PM
hey, is there a way in PHP where u can grab the current page URL? :confused: If so, how...
|
Click to See Complete Forum and Search --> : Getting the current page URL Kyleva2204 06-07-2005, 04:59 PM hey, is there a way in PHP where u can grab the current page URL? :confused: If so, how... NogDog 06-07-2005, 06:01 PM echo "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"; ShrineDesigns 06-07-2005, 06:57 PM you could use apache's mod_rewrite module to set an eviroment variable of the requested uri, then php would be access it via the $_ENV variable otherwise, it is not possible Kyleva2204 06-07-2005, 10:22 PM actually.. what nogdog said to do works 100%....... so yeah.. it is possible :P.. thanks nogdog :D Shmohel 06-08-2005, 07:57 AM To expand on Nogdog, check out http://us4.php.net/reserved.variables There is a lot of useful information stored in the $_SERVER variable. ShrineDesigns 06-08-2005, 01:45 PM the actual url of the requested uri is not stored by php, for instance, on my testing server, i can access it via http://localhost/ and http://sk1134.no-ip.org/ when i access it via http://sk1134.no-ip.org/ the $_SERVER['SERVER_NAME'] is still localhost weird, i looked at my phpinfo() and $_SERVER['HTTP_HOST'] actually stored the correct host name sk1134.no-ip.org * opens mouth, inserts foot * lol webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |