Dynadot โ€” .com Registration $8.99

PHP - Current Site URL

Spaceship Spaceship
Watch

GoldFiles

Established Member
Impact
0
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
PHP:
$currentPage="http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
Should work :)
 
0
•••
isn't $PHP_SELF the exact same thing or are you looking to add variables to the end of the url?
 
0
•••
Palyriot said:
isn't $PHP_SELF the exact same thing or are you looking to add variables to the end of the url?
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.
 
0
•••
yup! Thanks billy. That fixed my problem :)
 
0
•••
Good point Billy, but are these the same then?
$PHP_SELF and $_SERVER["REQUEST_URI"]?
 
0
•••
Palyriot said:
Good point Billy, but are these the same then?
$PHP_SELF and $_SERVER["REQUEST_URI"]?
Yep :)
 
0
•••
Oh ok, I think I'll use $PHP_SELF though lol.
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back