Click to See Complete Forum and Search --> : ASP Help #2


Delphi00
02-01-2004, 04:59 PM
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.