Hi
I want to be able to redirect people from
my predokument.asp to my dokument.asp
the first one is my prmember site and
the second is my member site...
They shall ONLY be redirected if the cookie
is on their pc*s if the cookie is not
there then just load the page....
How do I do that ?
Here is the code that checks for cookies....
predokument.asp
<%
' Dataconnection
Set Conn = Server.CreateObject("ADODB.Connection"
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("/db/hp.mdb"
Conn.Open DSN
Set rs = Server.CreateObject("ADODB.RecordSet"
if Session("loginOK"
= "natulivis" then
else
if request.cookies("forumData"
<> "" then
session("loginMemberID"
= request.cookies("forumData"
("brugerID"
strSQL = "SELECT * FROM medlemmer WHERE ID = " & session("loginMemberID"
set rs = Conn.Execute(strSQL)
response.write rs("ID"
if NOT rs.EOF then
session("loginOK"
= "naturligvis"
else
session("loginMemberID"
= ""
end if
else
response.redirect("formular.asp"
end if
end if
response.write request.cookies("forumData"
("brugerID"
Conn.Close
%>
<html>
<title>prepage</title>
<head>
</head>
<body bgcolor="#999966" text="#000000" link="#000000" vlink="#000000" alink="#FFFFFF">
<h1>Dette er forsiden</h1><br><br>
<%
'THIS is the login part that the people woith no cookie comes to
if Request.ServerVariables("REQUEST_METHOD"
= "POST" then
' Dataconnection
Set Conn = Server.CreateObject("ADODB.Connection"
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("hp.mdb"
Conn.Open DSN
Set rs = Server.CreateObject("ADODB.RecordSet"
username = replace(Request.Form("username"
,"'",""
password = replace(Request.Form("password"
,"'",""
strSQL= "SELECT * FROM medlemmer WHERE (brugernavn= '" & username & "' AND kode='" & password & "');"
Set rs = Conn.Execute (strSQL)
if not rs.EOF then
session("loginOK"
= "naturligvis"
session("loginMemberID"
= rs("ID"
response.cookies("forumData"
("brugerID"
= Session("loginMemberID"
response.cookies("forumData"
.Expires = now + 365
Conn.Close
'Den side man skal til når man er logget ind
Response.Redirect("dokument.asp"
else
session("loginOK"
= ""
session("loginMemberID"
= ""
Conn.Close
'Den side man skal til når man er logget ind
Response.Redirect("til.asp"
end if
else
session("loginOK"
= ""
session("loginMemberID"
= ""
response.cookies("forumData"
("brugerID"
= ""
end if
%>
<html>
<head></head>
<body>
<p>Velkommen til denne site login her:</p>
<table border="1">
<form method="post" action="formular.asp">
<tr><td>Brugernavn:</td><td><input name="username"></td></tr>
<tr><td>Password:</td><td><input type="password" name="password"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Login" name="Action">
<input type=hidden name=huskmig value=ja>
</td></tr>
</form></table><br><br><br><br>
<a href=" target="_blank">Anbefel Heilpraktikken</a><br><br>
<a href=" target="_blank">Kontakt</a><br>
</body>
</html>
I want to be able to redirect people from
my predokument.asp to my dokument.asp
the first one is my prmember site and
the second is my member site...
They shall ONLY be redirected if the cookie
is on their pc*s if the cookie is not
there then just load the page....
How do I do that ?
Here is the code that checks for cookies....
predokument.asp
<%
' Dataconnection
Set Conn = Server.CreateObject("ADODB.Connection"
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("/db/hp.mdb"
Conn.Open DSN
Set rs = Server.CreateObject("ADODB.RecordSet"
if Session("loginOK"
else
if request.cookies("forumData"
session("loginMemberID"
strSQL = "SELECT * FROM medlemmer WHERE ID = " & session("loginMemberID"
set rs = Conn.Execute(strSQL)
response.write rs("ID"
if NOT rs.EOF then
session("loginOK"
else
session("loginMemberID"
end if
else
response.redirect("formular.asp"
end if
end if
response.write request.cookies("forumData"
Conn.Close
%>
<html>
<title>prepage</title>
<head>
</head>
<body bgcolor="#999966" text="#000000" link="#000000" vlink="#000000" alink="#FFFFFF">
<h1>Dette er forsiden</h1><br><br>
<%
'THIS is the login part that the people woith no cookie comes to
if Request.ServerVariables("REQUEST_METHOD"
' Dataconnection
Set Conn = Server.CreateObject("ADODB.Connection"
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("hp.mdb"
Conn.Open DSN
Set rs = Server.CreateObject("ADODB.RecordSet"
username = replace(Request.Form("username"
password = replace(Request.Form("password"
strSQL= "SELECT * FROM medlemmer WHERE (brugernavn= '" & username & "' AND kode='" & password & "');"
Set rs = Conn.Execute (strSQL)
if not rs.EOF then
session("loginOK"
session("loginMemberID"
response.cookies("forumData"
response.cookies("forumData"
Conn.Close
'Den side man skal til når man er logget ind
Response.Redirect("dokument.asp"
else
session("loginOK"
session("loginMemberID"
Conn.Close
'Den side man skal til når man er logget ind
Response.Redirect("til.asp"
end if
else
session("loginOK"
session("loginMemberID"
response.cookies("forumData"
end if
%>
<html>
<head></head>
<body>
<p>Velkommen til denne site login her:</p>
<table border="1">
<form method="post" action="formular.asp">
<tr><td>Brugernavn:</td><td><input name="username"></td></tr>
<tr><td>Password:</td><td><input type="password" name="password"></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Login" name="Action">
<input type=hidden name=huskmig value=ja>
</td></tr>
</form></table><br><br><br><br>
<a href=" target="_blank">Anbefel Heilpraktikken</a><br><br>
<a href=" target="_blank">Kontakt</a><br>
</body>
</html>