请求来源
如何获取提交请求的 url。我尝试了 $_SERVER['REQUEST_URI'];但这给了我目标网址而不是源网址。能得到原产地吗?
How do I get the url from which the request was submitted. I tried $_SERVER['REQUEST_URI']; but this gives me the destination url not the source url. Is it possible to get the origin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在寻找
$_SERVER['HTTP_REFERER'];
注意:
You are looking for
$_SERVER['HTTP_REFERER'];
Note:
如果调用浏览器提供,则
$_SERVER['HTTP_REFERER']
将起作用。请注意,它是由客户端提供的,因此可能是空的或伪造的,因此在安全方面不要相信它。$_SERVER['HTTP_REFERER']
will work, if it is provided by the calling browser. Note that it is provided by the client so it may be empty or faked, so don't trust it security-wise.