HJÆLP
Hjælp til at få min adgangskontrol til at virker. jeg er ved at lave en side, som skal være betalt adgang. og til detformål skal jeg have en adgangskontrol der virker og kan giver bruger besked om at konto ikker ar aktiv eller er udløbet. men den vil ikke som jeg vil. hvis i vil i kontakt med mig kan i fange min på icq nr 56665453Min kode..
<%
Option Explicit
Dim Conn, RS, pagename, strMsg
If Session(\"userid\") <> \"\" Then
Response.Redirect \"./\"
End If
If Request(\"username\") <> \"\" Then
Set Conn = Server.CreateObject(\"ADODB.Connection\")
Conn.Open \"DRIVER={Microsoft Access Driver (*.mdb)};DBQ=\" & Server.MapPath(\"ibm.mdb\")
Set RS = Conn.Execute(\"SELECT * FROM users WHERE username = \'\" & LCase(Replace(Request(\"username\"),\"\'\",\"\'\'\")) & \"\' AND password = \'\" & LCase(Replace(Request(\"password\"),\"\'\",\"\'\'\")) & \"\'\")
If Not RS.EOF Then \' her har den funde bruger.
\' Session(\"userid\") = RS(\"ID\")
if rs(\"Konto_admin\") = false then Session(\"status\") = 1
if rs(\"Konto_admin\") = true then Session(\"status\") = 2
if session(\"Status\") = 1 then Session(\"userid\") = RS(\"id\")
if session(\"Status\") = 1 then Conn.Execute(\"UPDATE users SET dato_sidst = \'\" & now & \"\' WHERE username = \'\" & LCase(Replace(Request(\"username\"),\"\'\",\"\'\'\")) & \"\'\")
if Session(\"status\") = 2 then Session(\"userid\") = RS(\"id\")
if session(\"Status\") = 2 then Conn.Execute(\"UPDATE users SET dato_sidst = \'\" & now & \"\' WHERE username = \'\" & LCase(Replace(Request(\"username\"),\"\'\",\"\'\'\")) & \"\'\")
Set RS = Nothing
Conn.Close
if session(\"status\") = 1 THEN Response.Redirect \"./hep.asp\"
if session(\"status\") = 2 THEN Response.Redirect \"./admin.asp\"
Else
strmsg = \"Deres konto er ikke aktiv.. \"
End If
Set RS = Nothing
Conn.Close
End If
%>
<html>
<head>
<title><%=pagename%></title>
<style type=\"text/css\">
<!--
body, td {
font-family: Verdana, Arial;
font-size: 7 pt;
color: #ffffff
}
.button {
background-color: #ffffff;
border-bottom: #000000 solid 1px;
border-left: #000000 solid 1px;
border-right: #000000 solid 1px;
border-top: #000000 solid 1px;
cursor: hand;
padding: 3px 3px;
text-decoration: none;
text-align: center;
color: #darkred;
font-family: Verdana, Arial;
font-size: 8pt;
font-weight: bold;
width: 80;
}
-->
</style>
</head>
<body bgcolor=\"#000066\" text=\"#FFFFFF\" topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" onload=\"document.forms[0].username.focus()\">
<p align=\"center\"> </p>
<p align=\"center\"> </p>
<p align=\"center\">Hej</p>
<p align=\"left\"> </p>
<p align=\"center\"> </p>
<p align=\"left\"> </p>
<p align=\"left\"> </p>
<div align=\"center\">
<table border=\"1\" width=\"280\" bgcolor=\"#000000\" cellspacing=\"1\" cellpadding=\"0\" height=\"111\">
<tr>
<td rowspan=\"2\" width=\"301\" height=\"109\">
<div align=\"center\">
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"263\">
<tr>
<td bgcolor=\"#0D354F\" width=\"267\">
<p align=\"center\"><b><font color=\"#FFFFFF\">Login:</font></b></td>
</tr>
<tr>
<td bgcolor=\"#C0C0C0\" width=\"267\">
<form method=\"POST\" action=\"Default.asp\">
<table border=\"0\" width=\"79%\">
<tr>
<td width=\"39%\">
<p align=\"left\"><b><i><font color=\"#FF0000\" size=\"1\">Brugernavn</font></i></b></p>
</td>
<td width=\"66%\">
<p align=\"left\"><font color=\"#0D354F\"><input type=\"text\" name=\"username\" size=\"19\"></font></p>
</td>
</tr>
<tr>
<td width=\"39%\">
<p align=\"left\"><b><i><font color=\"#FF0000\" size=\"1\">Adgangskode</font></i></b> </p>
</td>
<td width=\"66%\">
<p align=\"left\"><font color=\"#0D354F\"><input type=\"password\" name=\"password\" size=\"19\"></font></p>
</td>
</tr>
<tr>
<td width=\"39%\">
<p align=\"left\"></td>
<td width=\"66%\">
<p align=\"left\"><input type=\"submit\" value=\"OK\"></p>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<p align=\"left\"> </p>
<%=strmsg%>
</body>
</html>