如何使用PHP获取以前的URL [英] How to get the previous url using PHP

查看:98
本文介绍了如何使用PHP获取以前的URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的网站的网址在互联网的某个页面上以超链接形式提供;该页面可能是互联网上的任何内容 - 博客,orkut,雅虎,甚至stackoverflow等,有人点击它,并访问我的网站。那么我们可以使用php知道访问者访问我页面的上一个URL吗?

Suppose my site's url is given as hyperlink on some page on the internet; that page could be anything on internet - blog, orkut, yahoo, even stackoverflow etc, and someone clicks on it,and visited my site. So can we know, using php, the previous url from which the visitor came to my page?

推荐答案

使用 $ _ SERVER ['HTTP_REFERER'] 标题,但请记住,任何人都可以随时欺骗它,无论他们是否点击链接。

Use the $_SERVER['HTTP_REFERER'] header, but bear in mind anybody can spoof it at anytime regardless of whether they clicked on a link.

这篇关于如何使用PHP获取以前的URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆