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 ... Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.