<%
'// by Ferruh Mavituna
'// ferruh@mavituna.com
'// http://ferruh.mavituna.com
Dim ThisPage
ThisPage = Request.ServerVariables("SCRIPT_NAME")
'// Set Session + password is Case Sensitive
If Request.Form("pass") <> "" Then
If Trim(Request.Form("pass")) = "yourpassword" Then Session("level") = "ok"
End If
'// Logout (xxx.asp?logout=ok)
If Request.Querystring("logout") <> "" Then Session("level") = ""
'// Ask for Login
If Session("level") <> "ok" Then
Response.Write "<form method=""post"" action=""" & ThisPage & """><input type=""password"" name=""pass"" /><input type=""submit"" value=""Login""/></form>"
Response.End
Else '// Logged + Show logout button
Response.Write "<a href=""" & ThisPage & "?logout=ok"">logout(x)</a>"
End If
%>
0 Comments:
Post a Comment