If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP Code help please

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-02-04, 01:17
Delphi00 Delphi00 is offline
Registered User
 
Join Date: Feb 2004
Posts: 5
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.
Reply With Quote
  #2 (permalink)  
Old 02-02-04, 03:45
MrWizard MrWizard is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 02-02-04, 08:57
Delphi00 Delphi00 is offline
Registered User
 
Join Date: Feb 2004
Posts: 5
i must be stupid, what an obvious mistake! thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On