哪个域调用了该脚本?

发布于 2024-11-19 12:12:18 字数 43 浏览 0 评论 0原文

我有一些确实需要保护的脚本。所以我在想,有没有办法找出哪个域调用了脚本?

I have some scripts that really need to be secured. So I was thinking, is there a way to find out which domain called the script?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

夜无邪 2024-11-26 12:12:18

查看 $_SERVER 变量,您会发现将看到您需要的所有信息。

$_SERVER['SERVER_ADDR']$_SERVER['SERVER_NAME'] 可能对您有用。

Look through the $_SERVER variable and you will see all the information you need.

$_SERVER['SERVER_ADDR'] and $_SERVER['SERVER_NAME'] may be of use to you.

你曾走过我的故事 2024-11-26 12:12:18

$_SERVER['HTTP_HOST'] 将拥有域名。

$_SERVER['HTTP_HOST'] will have the domain name.

过气美图社 2024-11-26 12:12:18

可能有很多方法可以做到这一点..但我会在脚本中设置日志记录并报告

$_SERVER['HTTP_HOST'] 

,这里是一个有用的页面以获取更多信息..

http://www.php.net/manual/en/reserved.variables.server.php

There are probably a lot of ways to do this.. But I would setup logging in the script and report back with

$_SERVER['HTTP_HOST'] 

And here is a helpful page for more information..

http://www.php.net/manual/en/reserved.variables.server.php

∞梦里开花 2024-11-26 12:12:18

维基百科列出了许多针对跨站点请求伪造攻击的防御措施。

Wikipedia lists a number of defences against cross site request forgery attacks.

春风十里 2024-11-26 12:12:18

$_SERVER['SERVER_NAME'] 将包含运行脚本的主机或虚拟主机。

$_SERVER['HTTP_HOST'] 包含当前请求的 Host: 标头的内容(如果有)。

请参阅 Chris Shiflett 的扩展解释,了解详细比较两个。

$_SERVER['SERVER_NAME'] will contain the host or virtual host under which the script is running.

$_SERVER['HTTP_HOST'] contains the contents of the Host: header from the current request, if there is one.

Please see Chris Shiflett's extended explanation for a detailed comparison of the two.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文