dragon7713 2011-04-05 11:30
浏览 36
已采纳

HTTP_REFERER返回NULL,$ _SERVER中不存在密钥

For the first time since using $_SERVER['HTTP_REFERER'] it gives me NULL as a result.

When I do var_dump($_SERVER) the HTTP_REFERER key does not exist.

I also try to visit site with different browsers and from different sites but with no result.

The website is running on a Linux/Apache based server.

How do I fix this?

  • 写回答

2条回答 默认 最新

  • doucong1992 2011-04-05 11:33
    关注

    Not all browsers will send the HTTP Referer header - you can't rely on it being sent. For instance, there are plenty of privacy addons which will disable sending of the header, or always send something specific rather than the real referring URL.

    A proxy between you and the server could also choose not to pass on this header.

    Also, of course, if you've gone straight to the URL in question, there is no referring URL to report.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭