PHP - Current Site URL

Spacemail by SpaceshipSpacemail by 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 TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomainEasy — Live Options
DomDB
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back