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. Link to comment https://forums.phpfreaks.com/topic/172123-output-full-url-of-current-page/ 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; ?> Link to comment https://forums.phpfreaks.com/topic/172123-output-full-url-of-current-page/#findComment-907539 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? Link to comment https://forums.phpfreaks.com/topic/172123-output-full-url-of-current-page/#findComment-936220 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.