前端之家收集整理的这篇文章主要介绍了
HTTP_REFERER 获取用户来路实例,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
http_referer 获取用户来路实例,这是个PHP自来全局变量,所以我们不多介绍了,直接看实例:
- <?PHP
- if (isset($_server['http_referer'])) {
- print "the page you were on prevIoUsly was {$_server['http_referer']}<br />";
- } else {
- print "you didn't click any links to get here<br />";
- }
- ?>
-
- <a href="refer.PHP">click me!</a>