开发者

How to find out what was the referral url?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜