NameSilo

PHP - Current Site URL

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

GoldFiles

Established Member
Impact
0
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
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
•••
CatchedCatched
Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back