Basically I have 2 websites. website1 is the main website which is a blog. Now I am sending visitors to website2 if the visitor is not logged in to website1. Then website2 redirects visitors back to the website1 with some data so that he can log in.
Now my goal is to check if the user is coming from website2 or not.
I tried
$referer_parse = parse_url($_SERVER['HTTP_REFERER']);
var_dump($referer_parse);
which returns array(1) { ["path"]=> string(0) "" }
I created an anchor tag for website1 and the visitors coming to website1 by clicking on the link shows the right things for the above code. But it is not working when website2 redirects automatically.