-2

I want to show certain content if traffic comes to my wordpress site from google search. I want to use $_SERVER["HTTP_REFERER"] . Security is not a huge issue -- if some client really wants to lie that they are coming thru google that is no big deal (they'll just see an ad). I also understand that I need to check what they send through $_SERVER["HTTP_REFERER"] for malicious code. However, I see that according to answers in this post Determining Referer in PHP not all browsers send HTTP_REFERER.

What browsers don't send it? What versions?

Community
  • 1
  • 1
bernie2436
  • 22,841
  • 49
  • 151
  • 244
  • you say you don't mind if they don't tell you, then what does it matter about browser, i strip mine, but not with a browser –  May 19 '14 at 20:22

1 Answers1

4

When the referring site has SSL turned on, it will often not include the HTTP_REFERER. As you can imagine, this is by design for security purposes. Code accordingly.

This makes it difficult to know when visitors are coming from sites like youtube and gmail which use SSL by default.

Also this question is similar: Is there referrer header while using SSL?

Community
  • 1
  • 1
iamdev
  • 716
  • 4
  • 13