GoldFiles Established Member โ 15 โ Impact 0 Mar 1, 2006 657 views 7 replies #1 I want to set whatever the current page url (example: http://www.goldfiles.com/games/page2/5456a.php) to a variable like $currentPage. Is there a PHP tool for this? thx
I want to set whatever the current page url (example: http://www.goldfiles.com/games/page2/5456a.php) to a variable like $currentPage. Is there a PHP tool for this? thx
Y yeppers VIP Member VIP โ 20 โ Impact 109 Mar 1, 2006 #2 PHP: $currentPage="http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; Should work
Palyriot Established Member โ 20 โ Impact 10 Mar 1, 2006 #3 isn't $PHP_SELF the exact same thing or are you looking to add variables to the end of the url?
Y yeppers VIP Member VIP โ 20 โ Impact 109 Mar 1, 2006 #4 Palyriot said: isn't $PHP_SELF the exact same thing or are you looking to add variables to the end of the url? Click to expand... PHP_SELF will give the directory and filename ie /a/b/file.php without the domain and "http://". GoldFiles said he wanted the http:// and domain, then folder and filename, like a nomrla URL.
Palyriot said: isn't $PHP_SELF the exact same thing or are you looking to add variables to the end of the url? Click to expand... PHP_SELF will give the directory and filename ie /a/b/file.php without the domain and "http://". GoldFiles said he wanted the http:// and domain, then folder and filename, like a nomrla URL.
GoldFiles Established Member โ 15 โ Impact 0 Mar 1, 2006 #5 yup! Thanks billy. That fixed my problem
Palyriot Established Member โ 20 โ Impact 10 Mar 2, 2006 #6 Good point Billy, but are these the same then? $PHP_SELF and $_SERVER["REQUEST_URI"]?
Y yeppers VIP Member VIP โ 20 โ Impact 109 Mar 2, 2006 #7 Palyriot said: Good point Billy, but are these the same then? $PHP_SELF and $_SERVER["REQUEST_URI"]? Click to expand... Yep
Palyriot said: Good point Billy, but are these the same then? $PHP_SELF and $_SERVER["REQUEST_URI"]? Click to expand... Yep
Palyriot Established Member โ 20 โ Impact 10 Mar 2, 2006 #8 Oh ok, I think I'll use $PHP_SELF though lol.