Get Full Url Path excluding PHP Script's name

Submitted by Anonymous (not verified) on Fri, 08/20/2010 - 15:48

PHP_SELF wont give you script path alone, it gives full path inclusive file.name. And "dirname(__FILE__)" gives you system path, nothing for web.


$full_url_path = "http://" . $_SERVER['HTTP_HOST'] . preg_replace("#/[^/]*\.php$#simU", "/", $_SERVER["PHP_SELF"]);

Add new comment