请求的来源 [英] source of REQUEST

查看:92
本文介绍了请求的来源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取提交请求的网址.我试过$ _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?

推荐答案

您正在寻找

You are looking for $_SERVER['HTTP_REFERER'];

注意:

其中的页面地址(如果有) 将用户代理推荐给当前 页.这是由用户代理设置的. 并非所有的用户代理都会对此进行设置,并且 有些提供修改的能力 HTTP_REFERER作为功能.简而言之, 它真的不能被信任.

The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

这篇关于请求的来源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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