monkeybidz Posted April 1, 2009 Share Posted April 1, 2009 I need help to redirect page depending on referer. If referer is https:www.paypal.com include thispage.php else include thatpage.php Can someone help with the code? This is what I have so far: $ref = getenv("HTTP_REFERER"); if($ref == "https://www.paypal.com"){ include "thispage.php"; }else{ include "thatpage.php"; } Link to comment https://forums.phpfreaks.com/topic/152130-http-refering-site/ Share on other sites More sharing options...
taquitosensei Posted April 1, 2009 Share Posted April 1, 2009 I think you're after $_SERVER['HTTP_REFERER'] if($_SERVER['HTTP_REFERER']=="https://www.paypal.com") { include "thispage.php"; } else { include "thatpage.php"; } the rest of it looks fine Link to comment https://forums.phpfreaks.com/topic/152130-http-refering-site/#findComment-798971 Share on other sites More sharing options...
Brian W Posted April 1, 2009 Share Posted April 1, 2009 Look into parse_url() because the current code setup will only match if they come from the paypal home page (which is highly unlikely or really cool). You'll just be looking to see if that is the domain they came from... Link to comment https://forums.phpfreaks.com/topic/152130-http-refering-site/#findComment-798975 Share on other sites More sharing options...
monkeybidz Posted April 1, 2009 Author Share Posted April 1, 2009 Would the http or https part make a difference? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/152130-http-refering-site/#findComment-798986 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.