3raser Posted March 12, 2011 Share Posted March 12, 2011 Hey, Within my experience of PHP, I have never had anything to do with making secure payments before. And this is a problem I can't seem to get around. I want to let people purchase a premium version of a game, and it will add their name to a PHP file or databse after they are redirected from PayPal to a special page that adds their username to the PHP file after typing it in. How would one make sure they don't just go to the webpage VIA the URL, and that they only came from the PHP redirect after purchase? Quote Link to comment https://forums.phpfreaks.com/topic/230389-verifying-payment/ Share on other sites More sharing options...
3raser Posted March 12, 2011 Author Share Posted March 12, 2011 Anyone feedback on this? _ | | | O /|\ /\ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^ Quote Link to comment https://forums.phpfreaks.com/topic/230389-verifying-payment/#findComment-1186485 Share on other sites More sharing options...
YourNameHere Posted March 12, 2011 Share Posted March 12, 2011 You can check the $_SERVER['HTTP_REFERER'] variable and make sure that it comes from paypals website. That is just one way to do it. I'm sure there are more. Quote Link to comment https://forums.phpfreaks.com/topic/230389-verifying-payment/#findComment-1186498 Share on other sites More sharing options...
denno020 Posted March 12, 2011 Share Posted March 12, 2011 If you're using Paypal for your payment method, then you can use their IPN scripts. Very secure, and apparently exceptionally hard to muck with.. Does take a bit of work to get going and to understand it, but it's very much worth it. Denno Quote Link to comment https://forums.phpfreaks.com/topic/230389-verifying-payment/#findComment-1186562 Share on other sites More sharing options...
3raser Posted March 12, 2011 Author Share Posted March 12, 2011 You can check the $_SERVER['HTTP_REFERER'] variable and make sure that it comes from paypals website. That is just one way to do it. I'm sure there are more. But when people finish a payment, does the URL have a lot of stuff like index.php?purchase_id=t7i 4ldskg;sfjg or something? Will if($_SERVER['HTTP_REFERER']=="http://www.paypal.com") work? Quote Link to comment https://forums.phpfreaks.com/topic/230389-verifying-payment/#findComment-1186668 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.