Jump to content

need url referrer redirect help please


silverglade

Recommended Posts

hi, im trying to redirect people after they pay to my "choose your password and username " page. but its not working, i come to a blank page after paypal payment. any help greatly appreciated. thanks. derek im trying to get them to choose.php, and it doesnt display a message.

 

<?php

$referrer = $_SERVER['HTTP_REFERER'];
if (strpos("paypal",$referrer)) {
      header('Location: http://mysite.com/choose.php');

  else {
      header('Location: http://mysite.com');
};


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
thank you, now you may choose your password and username
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/184727-need-url-referrer-redirect-help-please/
Share on other sites

the blank page is because you got a parse error you have not closed your if statement properly it should be

 

if (strpos("paypal",$referrer)) {
      header('Location: http://mysite.com/choose.php');

}  
else {
      header('Location: http://mysite.com');
}

awesome thank you! but its redirecting me to my main site page instead of the secret "choose your login" page, and i came from paypal "return to merchant" page. im trying to get it to go to  choose.php. i dont know why it wont. any more help GREATLY appreciated. thanks for fixing my code! derek (i have paypal set up to go to http://mysite.com/choose.php on the return.)

check if referrer that your getting on the script, I think the paypal integration returns you some parameters which you can check you don't need to check the referrer, not too sure about this long time since I used paypal integration

i learned how to use paypal's redirect so i can redirect buyers to my "choose a username and password" page where it updates the database of buyers and lets them log in later, but Anyone can now get to that page if they type in the url in their address bar, is there a way in PHP to prevent this please?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.