Get last page visited

前端 未结 2 1255
广开言路
广开言路 2021-01-02 13:56

I need to know if a person that comes to my website went from an another specific website. Example:

  • User A visits www.youtube.com/myvideo and clicks on a link
相关标签:
2条回答
  • 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

    0 讨论(0)
  • 2021-01-02 14:21

    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.

    0 讨论(0)
提交回复
热议问题