I have users logging into a site and I would like to store some details from the database in the session.
I am a complete newbie when it comes to sessions so I would also need the code for how to retrive this information.
the code that I am using at the moment is.
Or if you could suggest a better way to do this that would be great.
Thanks in advance
Manic
-----------------------------
I've broken it again !!
-----------------------------
I am a complete newbie when it comes to sessions so I would also need the code for how to retrive this information.
the code that I am using at the moment is.
Code:
<%
dim conn, strconn
strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & _
Server.MapPath("_users_.mdb")
set conn = server.createobject("adodb.connection")
conn.open strconn
UserName = Replace(Request("Username"), "'", "''")
Password = Replace(Request("Password"), "'", "''")
SQL = "SELECT * FROM my_users WHERE UserName = '" & UserName & "'" & _
"AND Password ='" & Password & "'"
set oRs = conn.Execute(SQL)
%>
<%
If oRs.EOF then
Response.Redirect("login2.asp")
Else
Session("ID") = "my_session" 'any word you'd like
Response.Redirect("administration.asp")
End If
Set conn = Nothing
Set oRs = Nothing
%>
Or if you could suggest a better way to do this that would be great.
Thanks in advance
Manic
-----------------------------
I've broken it again !!
-----------------------------