Hello,
I am working on a form that allows a user to create an account and then start filling out the form and then exit and re enter the form at the location that they left at.
I have created a sign in page that collects the user email and password and now I am working on creating the page that allows them to sign back in.
I am having issues looping through the database to see if the email string matches. My code works fine if the user already has an account and the usernames match but if the username is not found it fails.
I am searching the DB for the email address entered by the user and if there is no mach then I get an error- how do I loop without having to specify the email address in the SQL?
here is the code
I am working on a form that allows a user to create an account and then start filling out the form and then exit and re enter the form at the location that they left at.
I have created a sign in page that collects the user email and password and now I am working on creating the page that allows them to sign back in.
I am having issues looping through the database to see if the email string matches. My code works fine if the user already has an account and the usernames match but if the username is not found it fails.
I am searching the DB for the email address entered by the user and if there is no mach then I get an error- how do I loop without having to specify the email address in the SQL?
here is the code
Code:
<%@ language=JScript %>
<!-- #include file="adojavas.inc" -->
<html>
<head>
</head>
<body>
<%
var umail = Request.Form("uemail")
var userPass=Request.Form("upass")
Session("UserEmail") = umail.item;
Session("upass") = userPass.item;
var connect = Server.CreateObject("ADODB.Connection");
var record = Server.CreateObject("ADODB.RecordSet");
connect.Open("DSN=hhhba");
record.Open("select * from Data where EmailAddress ='"+ umail+"'", connect, adOpenKeyset, adLockOptimistic);
userName=record("EmailAddress");
str1 = userName.value;
str2 = umail.value;
if(str1!=str1)
{
Response.Write("Passowrd Fail")
}
else
{
Response.Write("Password Pass")
}
connect.close();
connect=null;
%>
</body></html>