📄 login.asp
字号:
<%@ CodePage = 936 LCID = 2052 %>
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<!--#include file="db.asp"-->
<!--#include file="aspmkrfn.asp"-->
<%
' User levels
Const ewAllowAdd = 1
Const ewAllowDelete = 2
Const ewAllowEdit = 4
Const ewAllowView = 8
Const ewAllowList = 8
Const ewAllowSearch = 8
Const ewAllowAdmin = 16
If Request.Form("submit") <> "" Then
bValidPwd = False
' Setup variables
sUserId = Request.Form("userid")
sPassWd = Request.Form("passwd")
If ((UCase("admin") = UCase(sUserId)) And (UCase("admin") = UCase(sPassWd))) Then
bValidPwd = True
End If
If bValidPwd Then
' Write cookies
If Request.Form("rememberme") <> "" Then
Response.Cookies("project1")("userid") = sUserId
Response.Cookies("project1").Expires = Date + 365 ' Change the expiry date of the cookies here
End If
Session("project1_status") = "login"
Response.Redirect "default.asp"
Else
Session("ewmsg") = "Incorrect user ID or password"
End If
End If
%>
<script type="text/javascript" src="ew.js"></script>
<script type="text/javascript">
<!--
function EW_checkMyForm(EW_this) {
if (!EW_hasValue(EW_this.userid, "TEXT" )) {
if (!EW_onError(EW_this, EW_this.userid, "TEXT", "Please enter user ID"))
return false;
}
if (!EW_hasValue(EW_this.passwd, "PASSWORD" )) {
if (!EW_onError(EW_this, EW_this.passwd, "PASSWORD", "Please enter password"))
return false;
}
return true;
}
//-->
</script>
<p> </p>
<p> </p>
<p> </p>
<p align="center"> 合同查询系统</p>
<%
If Session("ewmsg") <> "" Then
%>
<p><span class="aspmaker" style="color: Red;"><%= Session("ewmsg") %></span></p>
<%
Session("ewmsg") = "" ' Clear message
End If
%>
<form action="login.asp" method="post" onSubmit="return EW_checkMyForm(this);">
<table border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td><span class="aspmaker">User Name</span></td>
<td><span class="aspmaker"><input type="text" name="userid" size="20" value="<%= request.Cookies("project1")("userid") %>"></span></td>
</tr>
<tr>
<td><span class="aspmaker">Password</span></td>
<td><span class="aspmaker"><input type="password" name="passwd" size="20"></span></td>
</tr>
<tr>
<td> </td>
<td><span class="aspmaker"><input type="checkbox" name="rememberme" value="true">Remember me</span></td>
</tr>
<tr>
<td colspan="2" align="center"><span class="aspmaker"><input type="submit" name="submit" value="Login"></span></td>
</tr>
</table>
</form>
<br>
<p><span class="aspmaker">
</span></p>
<!--#include file="footer.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -