I need to know if a person that comes to my website went from an another specific website. Example:
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
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.