How to detect the site a user came from before mine in PHP?

前端 未结 6 1936
温柔的废话
温柔的废话 2020-12-07 02:38

How can I detect the site the user came from before accessing mine in PHP?

6条回答
  •  無奈伤痛
    2020-12-07 02:54

    echo $_SERVER['HTTP_REFERER'];
    

    It's not entirely reliable and can be spoofed, but in general it will be populated with the URL that the user clicked to get to the script.

提交回复
热议问题