Det virker ikke som det skal! hermed følger koden til det
<%
SET RS = Server.CreateObject("ADODB.Connection")
rs.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("lager.mdb")
If Request("mode") = "Check" then
' Authes user, password, and fixed a known securitybug to many login systems.
'strUsername = Trim(Replace(request("username"),"'","''" ))
strPassword = Trim(Replace(request("password"),"'","''" ))
Sql = "Select Count(*) as Found from MedarbejderTabel where (Brugernavn = '" & Trim(Replace(request("username"),"'","''" )) & "') and (Password ='" & strPassword & "')"
Set LO = RS.Execute(Sql)
if LO("Found") = 0 then
Session("login") = ""
error = "Du er ikke en godkendt medarbejder til at benytte dette system, kontakt webmasteren på Webmaster@testpilot.dk"
else
strDSN = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("lager.mdb")
Set myConn = Server.CreateObject("ADODB.Connection")
myConn.Open strDSN
strSQL = "SELECT * FROM MedarbejderTabel where (Brugernavn = '" & Request("username") & "') and (Password ='" & Request("password") & "')"
Set ez = myConn.Execute(strSQL)
Session("login") = "Authed"
Response.Redirect "medarb.asp"
ez.Close
RS.Close
Conn.Close
End if
End if
%>
<h4>Du skal være medarbejder for at benytte dette</h4>
<br />
<form action="logon.asp" method="post" onsubmit="MM_validateForm('username','','R','password','','R');return document.MM_returnValue">
<font face="verdana" size="2">Username:</font> <input class='text' type='text' name='username' size='15' style='font-family: Verdana; font-size: 8 pt' value="<%=Trim(Replace(request("username"),"'","''" ))%>" />
<br />
<font class="header"> <font face="verdana" size="2">Password:
</font><input class="text" type="password" value="<%=strpassword%>" name="password" size="15" style="font-family: Verdana; font-size: 8 pt" />
</font><br />
<p>
<input class="text" type="submit" value="Login" name="submit" style="font-family: Verdana; font-size: 8 pt" />
<input type="hidden" name="mode" value="Check" />
<br />
<br />
<%=error%>
</p>
<%
Response.Cookies("HTMLTest")("strUsername") = Trim(Replace(request("username"),"'","''" ))
Den ligger overhovedet ikke noget i cookien nu! hvad gør jeg galt ?