View Single Post
Old 08-01-2012, 08:55 PM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,188
Thanks: 59
Thanked 3,995 Times in 3,964 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
You can't put that year-checking code IN THE FORM!!!

It has to go at the top of the code that *PROCESSES* the form!

For example, maybe here:
Code:
<%
If (CStr(Request("MM_insert")) = "form1") Then
    Dim captcha
    capcha = 0
    On Error Resume Next
        captcha = CINT(Request.Form("year"))
    On Error GoTo 0
    If captcha <> Year(Date) Then
        Response.Redirect("wrong.asp")
    End If

   If (Not MM_abortEdit) Then
      ' execute the insert
      Dim MM_editCmd
      ...
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
367 (08-01-2012)