karthikeyan_coder Posted January 16, 2007 Share Posted January 16, 2007 how to get current url in PHP/IIS ? echo $_SERVER['REQUEST_URI']; //NOT workingecho $_SERVER['PHP_SELF']; // printing current docuemnt only...i am including skin.php (absolute path) in test.phpi puts $_SERVER['PHP_SELF']; in skin.php ... it is printing like .. path/skin.phpi need the url of test.php ... Link to comment https://forums.phpfreaks.com/topic/34379-how-to-get-current-url-phpiis/ Share on other sites More sharing options...
Hypnos Posted January 16, 2007 Share Posted January 16, 2007 http://us3.php.net/manual/en/reserved.variables.phpIf you search through the comments for "REQUEST_URI" you'll find several ways of dealing with this problem. Link to comment https://forums.phpfreaks.com/topic/34379-how-to-get-current-url-phpiis/#findComment-161799 Share on other sites More sharing options...
jeeva Posted January 16, 2007 Share Posted January 16, 2007 try [b]$_SERVER['DOCUMENT_ROOT'][/b].it will help u i think Link to comment https://forums.phpfreaks.com/topic/34379-how-to-get-current-url-phpiis/#findComment-161800 Share on other sites More sharing options...
jeeva Posted January 16, 2007 Share Posted January 16, 2007 or else try this one$host = $_SERVER['HTTP_HOST'];$self = $_SERVER['PHP_SELF'];$url = "http://$host$self";echo $url; Link to comment https://forums.phpfreaks.com/topic/34379-how-to-get-current-url-phpiis/#findComment-161805 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.