获取引荐来源网址-来自Paypal(HTTPS)的访客 [英] Get referrer URL - visitors coming from Paypal (HTTPS)

查看:101
本文介绍了获取引荐来源网址-来自Paypal(HTTPS)的访客的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取引荐来源网址,但是当访问者从Paypal进入该网站时,该网址不起作用

Hi I'm trying to get the referrer url but it doesn't work when the visitor comes to the site from Paypal

$ref = $_SERVER['HTTP_REFERER'];
echo $ref;

如果访问者来自Paypal,是否有一种简单的方法来获取Paypal网址?

Is there a simple way to get the paypal url if the visitor land on the site coming from Paypal ?

修改和说明: 我不想在Paypal网站上进行任何特殊设置(包括但不限于:IPN,设置返回URL,Paypal数据传输或Paypal网站上的任何其他特殊设置)访问者从Paypal到达网​​站时的URL引用,取决于交易的状态(如果有的话).

Edit and Clarification: I'm not looking to have any special settings on the Paypal site (including but not limited to: IPN, set the return URL, Payment Data Transfer or any other special settings on the Paypal site) All that I'm looking is to get the URL referer when visitors come to the site from Paypal, regardles of the status of a transaction (if there was one).

如鲍勃在手册中所指出的

As pointed by Bob from the manual

$ _ SERVER是一个包含标题,路径, 和脚本位置.该数组中的>条目是由 网络服务器.不能保证每个Web>服务器都会提供 这些中的任何一个;服务器可能会省略某些服务器,或提供未列出的其他服务器 在这里.

$_SERVER is an array containing information such as headers, paths, and script locations. The >entries in this array are created by the web server. There is no guarantee that every web >server will provide any of these; servers may omit some, or provide others not listed here.

所以剩下的唯一问题是-在贝宝网站上未设置任何内容的情况下,是否有任何解决方法?

So the only question left is - Is there any workaround to this without set something on the paypal site ?

推荐答案

如果您的站点使用HTTP(而非HTTPS),而PayPal使用HTTPS,则不会发送引荐来源网址!

In case your site uses HTTP (not HTTPS) and PayPal uses HTTPS, there is no Referrer being sent!

HTTP RFC-15.1.3在URI的状态下编码敏感信息:

客户端不应该在(非安全的)地址中包含Referer标头字段 HTTP请求(如果引用页面是通过安全的方式传输的) 协议.

Clients SHOULD NOT include a Referer header field in a (non-secure) HTTP request if the referring page was transferred with a secure protocol.

因此获取引荐来源网址的唯一方法是在您的网站上使用HTTPS.

So the only way to get the Referrer is to use HTTPS on your site.

这篇关于获取引荐来源网址-来自Paypal(HTTPS)的访客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆