source of REQUEST

前端 未结 2 1251
臣服心动
臣服心动 2020-12-20 22:29

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

2条回答
  •  天命终不由人
    2020-12-20 23:16

    $_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.

提交回复
热议问题