| The code is as follows |
Copy Code |
|
Session (' Time ') =now ()
Const a= #0:0:4# ' defines the number of seconds between intervals
If session ("Time2") >0 then ' if a value
If session ("Time2") +a > Sessions ("Time") Then '
Session ("Time2") =now ()
Response.Redirect "Look.asp"
End If
End If
Session ("Time2") =now () |
Method Two
Make a counter on this page
| The code is as follows |
Copy Code |
|
<%
If request ("form content") = "" Then
Session ("num") =0
Else
Session ("Num") =session ("num") +1
End If
' After submission
If session ("num") >0 Then
Response.Write "Do not submit data again!"
Response.End
End If
%> |
Method Three
Use cookies or sessions to process. Here is an example of a cookie:
Add.asp
| code is as follows |
copy code |
|
<% Response.Cookies ("submitflag") = "no"%>
save.asp
<%
If Request.Cookies ("submitflag") = "yes" Then
Response.Write "You cannot submit data repeatedly!"
response.end
End If
Rs. AddNew
...
Rs.update
Rs.close
Response.Cookies ("submitflag") = "yes"
%>
Database operation
Set rs= Conn.execute ("Select top 1 txt from DB where txt= '" &reqtxt& ")
If not (rs.eof Or rs.bof) then
Respon Se.write "Do not allow duplicate commits"
Else
Add data ....
End If |