Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get referrer URL - visitors coming from Paypal (HTTPS)

Tags:

People also ask

How do I get a referrer URL?

$_SERVER['HTTP_REFERER'] will give you the referrer page's URL if there exists any. If users use a bookmark or directly visit your site by manually typing in the URL, http_referer will be empty.

How check http referer in PHP?

The $_SERVER['HTTP_REFERER'] gives us referer URL to determine user requests on the server.


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;

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

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 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 ?