如何使用 PHP 获取引用 URL? [英] How can I get Referrer URL with PHP?

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

问题描述

如何使用 PHP 获取引用 URL,但 DIRECTORY 仅获取而不是整个链接(因此没有 http://domain.com/) 只有目录?

How can I get Referrer URL with PHP but the DIRECTORY only not the whole link (so without http://domain.com/) only the directory?

例如:

Referrer: /contact/user/9443/

不是这个<罢工>

http://domain.com/contact/user/9443/

谢谢!

推荐答案

我目前没有安装 PHP,但您可以尝试使用 parse_url.这应该我认为:

I don't have PHP installed at the moment, but you could try using parse_url. This should do it I think:

parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH);

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

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