It's a php page that first runs a mail script, then depending whether or not the email gets sent, a success page shows up to confirm it using the include() function.
I suppose if you can't disable "refresh", then what I'll have to do instead is change the confirmation page from an include to a redirect. Having said that, if the person was then to hit "back", I'd probably run into the same problem.
Having said THAT, I know that in PHP, we can detect what page was previously viewed, and if it is the success page, I can stop the script from executing.
Now, that's a lot of work, so here's my new question. Can I detect if the page has been refreshed using PHP? If so, I can insert just one or two lines of code, rather than about 50 (the confirmation page is a bit complicated).
i woulod just have one page do the actual mail(), and then pass the user to a different confirmation page using header("location:..."). then pressing refresh would not matter.
JavaScript cannot control the browser that way. James' suggestion is your best bet. Just redirect them away from the page to prevent them from refreshing it again.
Bookmarks