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"; } Quote Link to comment 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 Quote Link to comment 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... Quote Link to comment 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.