Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

PHP - Current Site URL

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

GoldFiles

Established Member
Impact
0
0
Close
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
Close
isn't $PHP_SELF the exact same thing or are you looking to add variables to the end of the url?
 
0
Close
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
Close
yup! Thanks billy. That fixed my problem :)
 
0
Close
Good point Billy, but are these the same then?
$PHP_SELF and $_SERVER["REQUEST_URI"]?
 
0
Close
Palyriot said:
Good point Billy, but are these the same then?
$PHP_SELF and $_SERVER["REQUEST_URI"]?
Yep :)
 
0
Close
Oh ok, I think I'll use $PHP_SELF though lol.
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back