Hi I have been asked to create a simple login form for a website and due to the lack of knowledge im struggling, so far I have a form which posts the information to the check.asp section
<% @language="vbsc ript"%><%
'#Connect to SQL database#'
Dim objConn, objRs, strSQL
Set objConn = Server.CreateOb ject("ADODB.Con nection")
objConn.Open "dsn=Oracle;uid =user1;pwd=pass word;"
set objRs=objConn.e xecute(strSQL)
%>
<%
frmuserid = Request.form("f rmuserid")
frmpassword = Request.form("f rmpassword")
strSQL = "SELECT * FROM login WHERE userid = '"&frmUserid &"' AND password = '"&frmpassword& "'"
Set objRs = objConn.execute (strSQL)
If (objRs.BOF) then
response.write ("Incorrect login, please try again.")
Response.Redire ct "login.asp"
ELSE
Response.Cookie s("Login")("frm userid") = frmuserid
Response.Cookie s("Login").Expi res = Date + 1
Response.Redire ct "welcome.as p"
End If
%>
<html>
<head>
<title>check</title>
</head>
<html>
<head>
<title>check</title>
</head>
<body>Checking. ........</body>
</html>
Now to me that should check the previous forms data and check it against the database but all I get is an uloadable page.
Any suggestions to put me on the right track?
Cheers
<% @language="vbsc ript"%><%
'#Connect to SQL database#'
Dim objConn, objRs, strSQL
Set objConn = Server.CreateOb ject("ADODB.Con nection")
objConn.Open "dsn=Oracle;uid =user1;pwd=pass word;"
set objRs=objConn.e xecute(strSQL)
%>
<%
frmuserid = Request.form("f rmuserid")
frmpassword = Request.form("f rmpassword")
strSQL = "SELECT * FROM login WHERE userid = '"&frmUserid &"' AND password = '"&frmpassword& "'"
Set objRs = objConn.execute (strSQL)
If (objRs.BOF) then
response.write ("Incorrect login, please try again.")
Response.Redire ct "login.asp"
ELSE
Response.Cookie s("Login")("frm userid") = frmuserid
Response.Cookie s("Login").Expi res = Date + 1
Response.Redire ct "welcome.as p"
End If
%>
<html>
<head>
<title>check</title>
</head>
<html>
<head>
<title>check</title>
</head>
<body>Checking. ........</body>
</html>
Now to me that should check the previous forms data and check it against the database but all I get is an uloadable page.
Any suggestions to put me on the right track?
Cheers
Comment