Form Submit Twice

Results 1 to 2 of 2

Thread: Form Submit Twice

  1. #1
    Join Date
    Dec 1969

    Default Form Submit Twice

    Hello All<BR>I am trying to code for a form submit against a database for login authentication.<BR><BR>I want to be able to give the user two attempts of logging in correctly, IF NOT, then redirect them to the Register.asp page.<BR><BR>After the first trip thru the LoginAuthenticate.asp page with no matching username found in the database, the page goes back to the login.asp page but now with an error stating no username was found in the database, please try again, also showing the username that was typed in the first time, so they can see if they simplay made a typing error. But if they submit the login username and password again(the Second Time) and no match is found in the database, redirect them to the Registration.asp page.<BR><BR>Here is a bit of code that I was using on the Submit button, but it is giving me a HTTP 405 Error.<BR><BR>form action="AuthLogin.asp &#060;%IF Request("SecondTry") = "True" THEN <BR> Response.Write "?SecondTry=True"<BR> End If %&#062;" <BR> method="post" name="Login" id="UserLogin"&#062;<BR><BR>Can you suggest a better way? Any assistance with this will be greatly appreciated.<BR><BR>Thanks in advance<BR>Andrew

  2. #2
    Join Date
    Dec 1969

    Default HIDDEN form field!

    *Please* don&#039;t build up query strings! They are *ALWAYS* prone to error! (In your case, you have a bogus space character before the &#060;%, incidentally.)<BR><BR>Use the hidden form field. *SO* much easier, more reliable, and it hides the details from the user!<BR><BR>&#060;FORM Action="AuthLogin.asp" Method="Post"&#062;<BR>&#060;% If Request("SecondTry") = "True" Then %&#062;<BR> &#060;INPUT Type=Hidden Name="SecondTry" Value="True"&#062;<BR>&#060;% End If %&#062;<BR>...<BR>&#060;/FORM&#062;<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts