dongsanhu4784 2014-01-30 11:20
浏览 88
已采纳

是否通过HTTP_REFERER传递了URL的查询段? [原文如此]

A simple enough question unspecific to any web programming language as most use the HTTP protocol and as such are able to retrieve and manipulate the referrer in the HTTP header.

An example:

I am on a webpage and see that the address bar displays example.com/index.php?user=John.

I click a link on the webpage which takes me to inemplum.com.

Say inemplum.com records traffic statistics including the HTTP referrers of its visitors, would this visit show up as example.com/index.php?user=John OR just example.com/index.php? Is this variable i.e. does it depend on the client and/or host OS, browser, language, firewall, etc.? This could perhaps complement the question title to CAN they be.

I know that every other segment can be passed; the protocol, domain, folder path (which in itself has implications) and filename, but this question is focused only on the query data and parameters used in the GET method.

  • 写回答

1条回答 默认 最新

  • doujianchao7446 2014-01-30 14:33
    关注

    From the tests that I have done on my end, local and across multiple servers, the parameters of the referring URL have all been passed to the HTTP_REFERER without any modifications to the servers, hacks, or the like. I did not cross-browser test this, however; I primarily use Firefox.

    A reference from the PHP manual that might help:

    'HTTP_REFERER' - The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.

    If this is purely for analytic tracking, the owner of "inemplum.com" should be able to provide you with a set of custom parameters to append to the URL that would patch directly into their tracking software. For instance, Google Analytic's utm_source=example.com, or Piwik's pk_campaign=whatever.

    In the event that "inemplum.com" is trying to do something with that data, simply pass the necessary parameters over via a standard GET by appending the parameters to the link. For example, inemplum.com/?user=Jon.

    Hope that helps!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。