如何确定目标=“_blank”的外部链接的Referrer?
我无法使用 PHP 捕获引荐来源网址:
$_SERVER['HTTP_REFERER'];
当访问者通过 target=" 的链接从 external-web-site.com 访问 mywebsite.com 时_blank",例如:
...
<a href="http://mywebsite.com" target="_blank">Link to My WebSite</a>
...
总是返回空结果而不是 external-web-site.com
是否可以正确获取 external-web-site.com,可以说使用 JavaScript 和 PHP 的组合或其他东西 别的?
提前致谢!
I am unable to catch the Referrer using PHP:
$_SERVER['HTTP_REFERER'];
when visitors come to mywebsite.com from an external-web-site.com via a link with target="_blank", for ex:
...
<a href="http://mywebsite.com" target="_blank">Link to My WebSite</a>
...
It always returns empty result instead of the external-web-site.com
Does it possible to correctly obtain external-web-site.com, lets say using combination of JavaScript and PHP or something else?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我找到了这个问题的解决方案。我建议我有一个 php 文件。所以我想要直接和_blank链接rediret ru.example.com和引用链接az.example.com。我有这个链接 az.example.com/index.php?id=123 我想要来自 facebook.com 或其他网站的 _blank 链接,我的页面不重定向。只重定向index.php
所以
index.php源代码:
I think i found this problem solution. I am suggesting that i have one php file. So i want direct and _blank link rediret ru.example.com and referred link az.example.com. And i have this link az.example.com/index.php?id=123 i want _blank link from facebook.com or another site my page not redirect. Only redirect index.php
so
index.php source code: