jdock1 Posted May 22, 2011 Share Posted May 22, 2011 I'm using paypal PDT, so when the user has made payment he gets directed back to my site, on that page it executes a special sql query. I noticed I can refresh the page to make duplicate sql queries. How can I avoid this?? Quote Link to comment https://forums.phpfreaks.com/topic/237085-how-to-avoid-duplicatemultiple-sql-queries-by-refreshing-page/ Share on other sites More sharing options...
Pikachu2000 Posted May 22, 2011 Share Posted May 22, 2011 You could set a $_SESSION var upon successful completion of the query, and check for it's presence before allowing the query to execute. IOW, if the var is set, the query has already executed, so don't allow it again. Quote Link to comment https://forums.phpfreaks.com/topic/237085-how-to-avoid-duplicatemultiple-sql-queries-by-refreshing-page/#findComment-1218589 Share on other sites More sharing options...
jdock1 Posted May 22, 2011 Author Share Posted May 22, 2011 Ha thanks good idea, pretty basic, its just there are so many way to do things in php its hard to come up with one, but if I would have thinked about it I would probably have done that lol thanks. Anybody else got a suggestion? Maybe a more secure way? A smart user could probably get around that. Quote Link to comment https://forums.phpfreaks.com/topic/237085-how-to-avoid-duplicatemultiple-sql-queries-by-refreshing-page/#findComment-1218598 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.