refiking Posted June 30, 2008 Share Posted June 30, 2008 What is wrong with this code? <? $last = $_SERVER['HTTP_REFERER']; Echo $last; ?> Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/ Share on other sites More sharing options...
jeremyapp Posted June 30, 2008 Share Posted June 30, 2008 <? should be <?php Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/#findComment-578398 Share on other sites More sharing options...
refiking Posted June 30, 2008 Author Share Posted June 30, 2008 Still doesn't work Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/#findComment-578400 Share on other sites More sharing options...
Daniel0 Posted June 30, 2008 Share Posted June 30, 2008 How doesn't it work? Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/#findComment-578401 Share on other sites More sharing options...
PFMaBiSmAd Posted June 30, 2008 Share Posted June 30, 2008 $_SERVER['HTTP_REFERER'] is an optional header that can be sent by a browser or a script, if they are configured to do so and if they feel like it. About the only thing you should use $_SERVER['HTTP_REFERER'] for is to log it for informational purposes. What are you using this for? Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/#findComment-578404 Share on other sites More sharing options...
refiking Posted June 30, 2008 Author Share Posted June 30, 2008 To Daniel, Your function returned Hello World. To PFM, I am using it to track which page a person clicked a particular link in my site. To Everyone, It retrieves the current URI with no problem. It's just the Referrer that's the problem. Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/#findComment-578406 Share on other sites More sharing options...
azfar siddiqui Posted July 1, 2008 Share Posted July 1, 2008 try echo basename($_SERVER['HTTP_REFERER']); Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/#findComment-578818 Share on other sites More sharing options...
Daniel0 Posted July 1, 2008 Share Posted July 1, 2008 To Daniel, Your function returned Hello World. Yes, it was in my signature. It was not part of my post. :-\ Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/#findComment-578875 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.