Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Unanswered: ASP Code help please

    Why doesn't this code work?

    ==============================================

    <html>
    <body>
    <%
    Response.Expires = -1000

    Dim oConn
    Dim oRS
    Dim sSQL
    Dim netid
    Dim pass1
    Dim pass2

    netid=request.form("netid")
    pass1=request.form("pass1")
    pass2=Password=request.form("pass2")

    if pass1=pass2 then

    Set oConn = Server.CreateObject("ADODB.Connection")
    oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\isclassof2003\db\ForSale.mdb"))

    sSQL = "INSERT INTO Student (NetID,Password) VALUES ('" & netid & "','" & pass1 & "')"

    Set oRS = oConn.Execute(sSQL)

    Response.Redirect("registerthanks.asp")

    Else

    Response.Redirect("registererror.asp")

    End if

    oConn.Close
    Set oRS = Nothing
    Set oConn = Nothing

    %>
    </body>
    </html>

    ==============================================

    It is basically processing a login form. It redirects me to the registererror.asp page (which i haven't put up yet but doesn't matter) even tho the first password matches the second one (i.e. pass1=pass2). Pass2 was a text field asking the user to confirm his password by re-typing it again. I checked the names and file of the previouslinked pages and they look fine.

  2. #2
    Join Date
    Mar 2003
    Location
    Atlanta, GA
    Posts
    191
    pass2=Password=request.form("pass2") is a bad line.

    I think you mean to have: pass2=request.form("pass2")


    I can't see anything else wrong.

    TIm
    Tim

  3. #3
    Join Date
    Feb 2004
    Posts
    5
    i must be stupid, what an obvious mistake! thanks

Posting Permissions

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