Hi,
I am pretty new to ASP and am trying to create a login page for a site. The form sends the username and password to this page:
<%@LANGUAGE="VBScript"%>
<%
Response.Expires = -1000 'Makes the browser not cache this page
Response.Buffer = True 'Buffers the content so our Response.Redirect will work
Session("UserLoggedIn") = ""
Session("OwnerLoggedIn") = ""
' *** Connect to database***
Dim myConn
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.open "Human","","dragon"
' *** Read the search form variable ***
Dim uName, uPassword
uName = CStr(Request("username"))
uPassword = CStr(Request("password"))
' *** get data ***
Dim mySQL
mySQL = "SELECT * FROM User WHERE Username = '" & uName & "' AND Password = '" & uPassword & "'"
' *** Record Set ***
Dim myRS
Set myRS = myConn.Execute(mySQL)
If myRS.BOF And myRS.EOF Then
Response.Redirect "index.htm"
Else
Session("UserLoggedIn") = "true"
If(myRS.Fields.Item("Security_ID").Value) = "2" then
Session("OwnerLoggedIn") = "true"
Response.Redirect "../Owner/OwnerPage.asp"
Else
Response.Redirect "UserPage.asp" & "?Userid=" & myRS("User_ID")
End if
End If
myConn.Close
Set myRS = Nothing
Set myConn = Nothing
%>
but the page won't display! (this page cannot be displayed) any ideas?