Why doesn't this code work?
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.<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>


Reply With Quote