TheJoey Posted March 26, 2010 Share Posted March 26, 2010 Just want to show the link, thought this would work but its not displaying anything for me. <?php $show = $_SERVER['HTTP_REFERER']; echo "$show"; ?> Link to comment https://forums.phpfreaks.com/topic/196572-referer-trouble/ Share on other sites More sharing options...
xcandiottix Posted March 26, 2010 Share Posted March 26, 2010 'HTTP_REFERER' The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted. http://php.net/manual/en/reserved.variables.server.php assuming you are trying to view which site your vistor came from. Link to comment https://forums.phpfreaks.com/topic/196572-referer-trouble/#findComment-1032092 Share on other sites More sharing options...
xcandiottix Posted March 26, 2010 Share Posted March 26, 2010 OH... btw your script is wrong.. echo "$show"; echo $show; Link to comment https://forums.phpfreaks.com/topic/196572-referer-trouble/#findComment-1032093 Share on other sites More sharing options...
TheJoey Posted March 26, 2010 Author Share Posted March 26, 2010 OH... btw your script is wrong.. echo "$show"; echo $show; is there a different way to do it without referer? Link to comment https://forums.phpfreaks.com/topic/196572-referer-trouble/#findComment-1032095 Share on other sites More sharing options...
xcandiottix Posted March 26, 2010 Share Posted March 26, 2010 The only thing close to this that I've used is the function that grabs the visitors IP address. You may want to cruise google for a stat tracker site or something if this is vital to what you are doing. Maybe someone else will know better. Link to comment https://forums.phpfreaks.com/topic/196572-referer-trouble/#findComment-1032096 Share on other sites More sharing options...
TheJoey Posted March 26, 2010 Author Share Posted March 26, 2010 I need to display the complete url , ill keep playing with it thanks Link to comment https://forums.phpfreaks.com/topic/196572-referer-trouble/#findComment-1032097 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.