hno Posted February 3, 2010 Share Posted February 3, 2010 HI I hear If I write "echo $_SERVER['HTTP_REFERRER']; " and anybody search in google and find my site in there and come to my site by using google It will print what he has been search in google.I do that And I put that code in my site and I came from google to my site but it didn't print anything.How should I solve the problem? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/190754-_serverhttp_referrer-does-not-work/ Share on other sites More sharing options...
JasonLewis Posted February 3, 2010 Share Posted February 3, 2010 You do realise it's: echo $_SERVER['HTTP_REFERER']; And not: echo $_SERVER['HTTP_REFERRER']; There is no double R. This is taken directly from the PHP Manual, something you should've looked at: 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. I highlighted the important parts. Regards, Project Fear Quote Link to comment https://forums.phpfreaks.com/topic/190754-_serverhttp_referrer-does-not-work/#findComment-1005944 Share on other sites More sharing options...
hno Posted February 3, 2010 Author Share Posted February 3, 2010 You do realise it's: echo $_SERVER['HTTP_REFERER']; And not: echo $_SERVER['HTTP_REFERRER']; There is no double R. This is taken directly from the PHP Manual, something you should've looked at: 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. I highlighted the important parts. Regards, Project Fear Thanks for your reply But it didn't work either: echo $_SERVER['HTTP_REFERER']; Could you give me an example please?And could you show me a site that use that? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/190754-_serverhttp_referrer-does-not-work/#findComment-1005955 Share on other sites More sharing options...
hno Posted February 3, 2010 Author Share Posted February 3, 2010 You do realise it's: echo $_SERVER['HTTP_REFERER']; And not: echo $_SERVER['HTTP_REFERRER']; There is no double R. This is taken directly from the PHP Manual, something you should've looked at: 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. I highlighted the important parts. Regards, Project Fear Thanks for your reply But it didn't work either: echo $_SERVER['HTTP_REFERER']; Could you give me an example please?And could you show me a site that use that? Thanks Could some one helps me? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/190754-_serverhttp_referrer-does-not-work/#findComment-1006016 Share on other sites More sharing options...
PFMaBiSmAd Posted February 3, 2010 Share Posted February 3, 2010 $_SERVER['HTTP_REFERER'] is an optional header that the browser provides when it makes a http request. If it is not set, then it is not set and you cannot do anything about it. Quote Link to comment https://forums.phpfreaks.com/topic/190754-_serverhttp_referrer-does-not-work/#findComment-1006021 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.