Dont execute code on page reload

I have an asp page which when loads, sends notification emails and adds data to a Mysql database.people refreshing the page or when navigating back to the page using the browser, this script is run again. So to stop the code to execute again on page reload insert the below code into the page.

CODE:
<%
if Request.Cookies("Mail")<>"" then
Response.Write "cant mail twice!!"
else
Response.Cookies("mail")="Ams"
Response.Write "Mailed!!"
//Put your insert/mail code here.
end if
%>

0 comments:

Post a Comment