开发者

How to find out what was the referral url?

开发者 https://www.devze.com 2023-01-30 16:28 出处:网络
People come to my website from variety of other websites and I would like to know these referral 开发者_如何学JAVAurls? How can I do it in PHP? You can get the referrer using $_SERVER[\'HTTP_REFERER\'

People come to my website from variety of other websites and I would like to know these referral 开发者_如何学JAVAurls? How can I do it in PHP?


You can get the referrer using $_SERVER['HTTP_REFERER']. Note that it's very easy for the client to spoof this, so don't rely on it for anything important.

You can find out about other $_SERVER variables here.


$ref = getenv("HTTP_REFERER");

or

$ref = $_SERVER['HTTP_REFERER'];


Use the system variable:

$_SERVER['HTTP_REFERER']

Check this answer for more details.

Determining Referer in PHP

0

精彩评论

暂无评论...
验证码 换一张
取 消