ASP Help #2

Sharky Forums


Results 1 to 1 of 1

Thread: ASP Help #2

  1. #1
    Thread Killer Delphi00's Avatar
    Join Date
    Jun 2003
    Location
    Bay Area, CA
    Posts
    3,327

    ASP Help #2

    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.
    Last edited by Delphi00; 02-01-2004 at 06:01 PM.
    Rig:
    P4 2.4C @ 3.0Ghz | Abit IC7 | Thermalright SLK 947U + Enermax 90mm | Scythe Ultra Kaze 120mm | Corsair 3GB | PowerColor HD3850 AGP | Antec SLK3700AMB | Enermax Whisper II 535W | Hercules Fortissimo III 7.1 | Samsung 931B | Logitech Z-2300 | WinXP Pro

Posting Permissions

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