I need to know if a person that comes to my website went from an another specific website. Example:
Results Message on my page:
Welcome! You already know how it works, register now!
Welcome! Please watch our video first at www.youtube.com/myvideo
My question is:
$_SERVER['HTTP_REFERER']
with PHP, but it's not working correctly and I read that does not work on all browsers. The HTTP referer header is the only way. This is the data that is given to you in PHP via $_SERVER['HTTP_REFERER']
.
Note that this header will work in most cases. Also note that it can be easily spoofed.
Why not add a GET variable to the link on youtube - www.yoursite.com/?referrer=youtube
For discretion and appearance you could rewrite the URL to something like www.yoursite.com/youtube
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With