hi all
I have a contact page and i am redirecting the page to same page after the mail sent sucessfully.But when i am refreshing the page ,all the data is again inserted into the database and agian sending a mail to same person.How
can i avoid this?
please help me
Thanks
refresh page -help please
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
Using
would solve your problem. You could also set a session variable to a random string after the data is inserted, place a hidden input tag in the form with that same string, and check the random string in the session against the one in $_POST or $_GET.
Code: Select all
header('Location: http://www.mysite.com');