Kære olebole og arne.
det virker ikke.. hmm
ok, jeg åbene hele sider med asp-kode:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/loginind.asp" -->
<%
Conn = Server.CreateObject("ADODB.Connection");
Conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("login.mdb"));
%>
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString <> "" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString)
MM_valUsername = CStr(Request.Form("navntext"))
If MM_valUsername <> "" Then
Dim MM_fldUserAuthorization
Dim MM_redirectLoginSuccess
Dim MM_redirectLoginFailed
Dim MM_loginSQL
Dim MM_rsUser
Dim MM_rsUser_cmd
MM_fldUserAuthorization = "kodetext"
MM_redirectLoginSuccess = "tilfoeje.asp"
MM_redirectLoginFailed = "fejl.asp"
MM_loginSQL = "SELECT navntext, kodetext"
If MM_fldUserAuthorization <> "" Then MM_loginSQL = MM_loginSQL & "," & MM_fldUserAuthorization
MM_loginSQL = MM_loginSQL & " FROM loginasp WHERE navntext = ? AND kodetext = ?"
Set MM_rsUser_cmd = Server.CreateObject ("ADODB.Command")
MM_rsUser_cmd.ActiveConnection = MM_loginind_STRING
MM_rsUser_cmd.CommandText = MM_loginSQL
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param1", 200, 1, 50, MM_valUsername) ' adVarChar
MM_rsUser_cmd.Parameters.Append MM_rsUser_cmd.CreateParameter("param2", 200, 1, 50, Request.Form("kodetext")) ' adVarChar
MM_rsUser_cmd.Prepared = true
Set MM_rsUser = MM_rsUser_cmd.Execute
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied")) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="
http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>admin</title>
<style type="text/css">
<!--
.style3 {font-size: 16px}
-->
</style>
</head>
<body>
<form id="form1" name="logind" method="POST" action="<%=MM_LoginAction%>">
<table width="150" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" bgcolor="#666666"> </td>
</tr>
<tr>
<td><span class="style3">Navn:</span></td>
<td><input name="navntext" type="text" id="navntext" value="<%=(loginind.Fields.Item("navntext").Value)%>" size="30" /></td>
</tr>
<tr>
<td>kode:</td>
<td><input name="kodetext" type="password" id="kodetext" value="<%=(loginind.Fields.Item("kodetext").Value)%>" size="30" /></td>
</tr>
<tr>
<td><input type="submit" name="login" id="login" value="login ind" /></td>
<td> </td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
<%
loginind.Close()
Set loginind = Nothing
%>