Im on no sleep and have a deadline

importdistributors

Senior member
Sep 14, 2004
294
0
0
I have to make my websites shopping cart have a log in for existing user. I basically just need a good if statement. I also might note that it is linked to access. I have been working on it since 4pm yesterday.

Login Code:

<html>
<head><title>Simple HTML Form</title></head>
<body>

<form method="post" action="LoginResult.asp">
<b>Email Address: </b>
<input name="txtEmail" type="text" size=30>

<p>
<b>Password: </b>
<input name="txtPassword" type="password" size=10>
<p>
<input type="submit" value="LOGIN">
</form>

</body>
</html>


Login Result:

<%

Dim CustEmail as String
Dim CustPassword as String

CustEmail = Request.Form("txtEmail")
CustPassword = Request.Form("txtPassword")

'connect to Customer table

<%
set dbMain = server.createobject("ADODB.Connection")
dbMain.open session("dblogin")
Set rsCustomer = Server.CreateObject("ADODB.Recordset")


sSQL = "SELECT * FROM Customer_t WHERE Email_ID = '" & CustEmail & "'" & _
" and Password = '" & CustPassword & "'"
rsCustomer.open sSQL, dbMain, adopenstatic, adlockpessimistic, adcmdtext
%>
<% if rsCustomer.eof then %>
%>

Any help is appreciated.
 

nakedfrog

No Lifer
Apr 3, 2001
62,981
19,237
136
Don't you mean more like:
if not rsCustomer.EOF then
session("logged_in") = true
else
'some kind of error
end if
?

You should probably also do the username check first, then password, so you can differentiate whether the user is found or the password is wrong.


Also, wrong forum, we have a programming forum.