close window
Jeg vil gerne kunne lukke at popup vindue efter at logge ind, jeg benytter Response.write \"self.close();\" længere nede med her er koden:<%@LANGUAGE=\"VBSCRIPT\"%>
<!--#include file=\"Connections/02.asp\" -->
<%
set rs_user = Server.CreateObject(\"ADODB.Recordset\")
rs_user.ActiveConnection = MM_reddot2002_STRING
rs_user.Source = \"SELECT * FROM side\"
rs_user.CursorType = 0
rs_user.CursorLocation = 2
rs_user.LockType = 3
rs_user.Open()
rs_user_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
\' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables(\"URL\")
If Request.QueryString<>\"\" Then MM_LoginAction = MM_LoginAction + \"?\" + Request.QueryString
MM_valUsername=CStr(Request.Form(\"txtbrugernavn\"))
If MM_valUsername <> \"\" Then
MM_fldUserAuthorization=\"\"
MM_redirectLoginSuccess=\"close.asp\"
MM_redirectLoginFailed=\"noaccess.asp\"
MM_flag=\"ADODB.Recordset\"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_reddot2002_STRING
MM_rsUser.Source = \"SELECT user, pass\"
If MM_fldUserAuthorization <> \"\" Then MM_rsUser.Source = MM_rsUser.Source & \",\" & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & \" FROM side WHERE user=\'\" & MM_valUsername &\"\' AND pass=\'\" & CStr(Request.Form(\"txtpassword\")) & \"\'\"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
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 true Then
MM_redirectLoginSuccess = Request.QueryString(\"accessdenied\")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
Response.write \"self.close();\"
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
<html>
<head>
<title>Login</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
<link rel=\"stylesheet\" href=\"css.css\" type=\"text/css\">
</head>
<body bgcolor=\"#CCFFFF\" text=\"#000000\" scroll=\"no\" onload=\"f=document.login.txtbrugernavn;f.focus();f.select();\">
<form name=\"login\" method=\"post\" action=\"<%=MM_LoginAction%>\">
<table cellspacing=\"0\" cellpadding=\"5\" width=\"248\">
<tr>
<td width=\"183\" height=\"2\"> <font face=\"Verdana, Arial, Helvetica, sans-serif\"><span class=\"tekstfelter\">brugernavn:</span><span class=\"tekst\">
</span> <br>
<input type=\"text\" name=\"txtbrugernavn\" class=\"formfelter\">
<br>
<span class=\"tekstfelter\">adgangskode: </span><br>
<input type=\"password\" name=\"txtpassword\" class=\"formfelter\">
</font> </td>
<td width=\"63\" height=\"2\" valign=\"bottom\">
<table width=\"95%\" border=\"0\" cellpadding=\"1\">
<tr>
<td><font face=\"Verdana, Arial, Helvetica, sans-serif\">
<input type=\"submit\" action=\"close.asp\" name=\"Submit\" value=\"login\" class=\"formknap\">
</font></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<%
rs_user.Close()
%>
