How can I detect the site the user came from before accessing mine in PHP?
You could check at the Referer HTTP Header :
echo $_SERVER['HTTP_REFERER'];
But note that the Referer is sent by the browser, which means :
So, you can use the referer to provide an additional feature on your website, but you have to make sure that your website doesn't rely on it : your application must still work, even if the Referer is not present.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With