开发者

Getting PHP Referral with "&" in URL String

I am trying to get the referring URL with PHP using:

echo  $_SERVER['HTTP_REFERER']

This is working, however when I attach variables to the URL string with "&"s, the referer shows as blank. If the &'s开发者_运维技巧 are replaced with the html version "& a m p;", the referer works again.

I need a way for the referer to work with the "&" symbol.

The referrer is going to be captured from tracking URLs like this one:

http://www.example.com/link.php?var1=data&var2=data&var3=data

Any suggestions/solutions would be greatly appreciated!

**I realize that the referer may be spoofed, but still wish to access this information.


When you change the URL manually, your browser won't sent the referer with the next request. If you change the URL with firebug, then click on it, it should populate properly.

On a sidenote, you shouldn't trust the referer because people can tell their browser to submit anything they want as the referer.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜