NameSilo

PHP - Current Site URL

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
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: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back