silverglade Posted December 11, 2009 Share Posted December 11, 2009 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 More sharing options...
rajivgonsalves Posted December 11, 2009 Share Posted December 11, 2009 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'); } Link to comment https://forums.phpfreaks.com/topic/184727-need-url-referrer-redirect-help-please/#findComment-975191 Share on other sites More sharing options...
silverglade Posted December 11, 2009 Author Share Posted December 11, 2009 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.) Link to comment https://forums.phpfreaks.com/topic/184727-need-url-referrer-redirect-help-please/#findComment-975194 Share on other sites More sharing options...
rajivgonsalves Posted December 11, 2009 Share Posted December 11, 2009 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 Link to comment https://forums.phpfreaks.com/topic/184727-need-url-referrer-redirect-help-please/#findComment-975196 Share on other sites More sharing options...
silverglade Posted December 11, 2009 Author Share Posted December 11, 2009 ok thanks very much for helping me! derek Link to comment https://forums.phpfreaks.com/topic/184727-need-url-referrer-redirect-help-please/#findComment-975296 Share on other sites More sharing options...
silverglade Posted December 11, 2009 Author Share Posted December 11, 2009 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? Link to comment https://forums.phpfreaks.com/topic/184727-need-url-referrer-redirect-help-please/#findComment-975372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.