refiking Posted June 30, 2008 Share Posted June 30, 2008 What is wrong with this code? <? $last = $_SERVER['HTTP_REFERER']; Echo $last; ?> Quote 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 Quote 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 Quote 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? Quote 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? Quote 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. Quote 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']); Quote 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. :-\ Quote Link to comment https://forums.phpfreaks.com/topic/112625-_serverhttp_referer-not-working/#findComment-578875 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.