gpt4 book ai didi

Php 引荐来源网址是否有效?

转载 作者:太空宇宙 更新时间:2023-11-04 13:39:45 25 4
gpt4 key购买 nike

我需要知道我网站上某个页面的引荐服务器。

是否有任何安全的方法来检查用户从何处“来到”页面?

我尝试将其上传到我的服务器,但是当我将地址写入浏览器地址栏中的文件时,这根本不会输出任何内容:

    <?php echo $_SERVER['HTTP_REFERER']; ?>

我需要检查这个以便在页面上显示链接...

谢谢

最佳答案

Is there any safe method to check where the user "came" to the page FROM?

不是真的。与所有 HTTP header 一样,这可以很容易地修改。此外,浏览器也可以选择从不发送引荐来源网址。

$_SERVER['HTTP_REFERER']; 将在浏览器确实发送引荐来源网址时起作用,但无法验证它是否真实。

I tried uploading this to my server, but this wont output anything at all when I write the adress to the file in the browsers adress bar

在这种情况下,浏览器不会发送引荐来源网址,因为您不是来自任何地方。

关于Php 引荐来源网址是否有效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3007927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com