vijdev Posted October 22, 2010 Share Posted October 22, 2010 "BACK" or REFRESH: Preventing database interaction / code execution how to prevent database interaction / code execution when user presses back or refresh button? can i detect? can i disable back/refresh? Quote Link to comment https://forums.phpfreaks.com/topic/216530-back-or-refresh-preventing-database-interaction-code-execution/ Share on other sites More sharing options...
Pikachu2000 Posted October 22, 2010 Share Posted October 22, 2010 Assuming the database action in question is an insert, you can use INSERT IGNORE syntax, or INSERT INTO . . . ON DUPLICATE KEY UPDATE syntax. Quote Link to comment https://forums.phpfreaks.com/topic/216530-back-or-refresh-preventing-database-interaction-code-execution/#findComment-1125087 Share on other sites More sharing options...
vijdev Posted October 22, 2010 Author Share Posted October 22, 2010 thanks.ok, let me try that...out! how abt preventing an e-mail being sent? do you think setting field for "email_sent" as yes/no and sending only if "no"..is a good way? Quote Link to comment https://forums.phpfreaks.com/topic/216530-back-or-refresh-preventing-database-interaction-code-execution/#findComment-1125092 Share on other sites More sharing options...
Pikachu2000 Posted October 22, 2010 Share Posted October 22, 2010 I usually use a header() redirect after a successful mail(). Then if they hit back, all they get is a blank form. Quote Link to comment https://forums.phpfreaks.com/topic/216530-back-or-refresh-preventing-database-interaction-code-execution/#findComment-1125094 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.