问题描述
我正在尝试获取引荐来源网址,但是当访问者从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
所以剩下的唯一问题是-在贝宝网站上未设置任何内容的情况下,是否有任何解决方法?
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的状态下编码敏感信息:
因此获取引荐来源网址的唯一方法是在您的网站上使用HTTPS.
So the only way to get the Referrer is to use HTTPS on your site.
这篇关于获取引荐来源网址-来自Paypal(HTTPS)的访客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!