jwhite68 Posted July 23, 2007 Share Posted July 23, 2007 I have a fairly simple PHP page, which takes form input for a message, and on pressing the send button, it sends an email out. The problem I have is that when a user presses refresh, it sends the email out again. I use a form action to send a hardcoded value of sent=1, which reruns the script in order to send the email out. So when pressing refresh, it still has this value of 1 set, and hence the issue. Does anyone have any advice on how best to deal with refresh, so its not processing the form again? Quote Link to comment Share on other sites More sharing options...
btherl Posted July 23, 2007 Share Posted July 23, 2007 The simplest method I can think of is to set a session variable. If you're not familiar with sessions, it's time to learn They are very useful things. If you set the session variable when the form is first submitted, then you can test it the second time and recognize that something is awry. Quote Link to comment Share on other sites More sharing options...
jwhite68 Posted July 23, 2007 Author Share Posted July 23, 2007 Thanks. Thats done the trick. Quote Link to comment 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.