Omzy Posted August 27, 2009 Share Posted August 27, 2009 Let's say I am currently viewing a dynamic page: http://www.mydomain.com/directory/index.php?type=flowers I want this URL to be output on the page, but not including the end parameters. Quote Link to comment Share on other sites More sharing options...
gaza165 Posted August 27, 2009 Share Posted August 27, 2009 <?php $url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; echo $url; ?> Quote Link to comment Share on other sites More sharing options...
Omzy Posted October 13, 2009 Author Share Posted October 13, 2009 I find it odd that PHP needs 3 different values (1 of which has to be hardcoded) to output the full URL of the page it's displaying from the server! Surely there's got to be a simpler method? 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.