I am attempting to creata a login page. I am having difficulty. Also the connection for the database I got from a site. Please advice!!
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'checks for absence of the sign in button
if isempty(Request.Form("LogIn")) then
'if absent then it is the first attepmt
Session("NumAttempts") = 1
'variable is created
TheMessage = "Please Login:"
else
default_DB_Path = Request.ServerVariables("APPL_PHYSICAL_PATH") & "geo.mdb"
geo = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & default_DB_Path & ";"
Set default_DB_conn = Server.CreateObject("ADODB.Connection")
default_Db_conn.Open geo
mySQL = "SELECT ID, userName, email FROM LogIn WHERE " _
& "email = '" & Request.Form("email") & "' and " _
& "passwordd = '" & Request.Form("password") & "'")
if RSLogin.EOF then
Session("NumAttepmts") = Session("NumAttempts") + 1
if Application("NumAttempts") = 0 then
TheMessage = "Login not found, pleae try again:"
'compares number of login attempts to number allowed
elseif Session("NumAttempts") > Application("NumAttempts") then
TheMessage = "Login not found. No more attempts allowed."
else
TheMessage = "Login not found, please try again:"
end if
else
'session variables are created to store information about the visitor
Session("ID") = RSLogin("ID")
Session("userName") = RSLogin("userName")
Response.Redirect "index.asp"
'to call the username during the session
'<%= session("userName")%>
<html>
<head>
<title>LogIn Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
window.defaultStatus = "Welcome, Please Login";
</script>
</head>
<body>
<p><center><% Response.Write TheMessage %></center></p>
<%
if TheMessage <> "Login not found. No more attempts allowed." then
%>
<form action="edit.asp" method="post">
<p><table width="40%" align="center" border="0" cellpadding="5" cellspacing="10">
<tr>
<td width="40%">User Name:</td>
<td><input type="text" name="userName" value="" size="30" maxlength="25"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="text" name="password" value="" size="30" maxlength="25"></td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" name="LogIn" value="LogIn" ></center></td>
</tr>
<tr>
<td colspan="2"><center><a href="new_login.asp">Are you a new user?</a></center></td>
</tr>
</table></form>
</body>
</html>
Thanks in advance!!
Thanks!
nvillare