📄 login.asp
字号:
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>代理商登陆</title>
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #000000;
}
a:link {
color: #0000FF;
text-decoration: none;
}
a:visited {
color: #0000FF;
text-decoration: none;
}
a:hover {
color: #FF0000;
text-decoration: underline;
}
a:active {
text-decoration: none;
}
-->
</style></head>
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<%
action_e=request.Querystring("action")
Select Case action_e
Case ""
Call main()
Case "chklogin"
Call chklogin()
Case "logout"
Call logout()
end select
%>
<%
sub main
%>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50"> </td>
</tr>
</table>
<table width="400" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
<tr>
<td align="center" class="font1"><strong>代理商管理登陆</strong></td>
</tr>
</table>
<table width="400" height="150" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<form name="form1" method="post" action="login.asp?action=chklogin">
<td align="center" bgcolor="#F7F7F7"><table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="25" align="right">代理商账号:</td>
<td align="left"><input name="username" type="text" class="input1" id="username"></td>
</tr>
<tr>
<td height="25" align="right">代理商密码:</td>
<td align="left"><input name="password" type="password" class="input1" id="password"></td>
</tr>
<tr>
<td height="25" align="right">验证码:</td>
<td align="left"><input name="vcode" type="text" class="input1" id="vcode" size="4" maxlength="4">
<img src="../inc/vcode.asp"></td>
</tr>
</table>
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40" align="center">
<input name="Submit" type="submit" class="button1" value="登 陆">
<input name="Submit" type="reset" class="button1" value="重 写">
</td>
</tr>
</table></td>
</form>
</tr>
</table>
<%
end sub
sub chklogin
call myobj.chkrq()
if request.Form("vcode")="" or myobj.ChkLen(request.Form("vcode"))>4 then
response.write"<script language=javascript>alert('验证码格式错误');history.back();</Script>"
response.end
end if
if UCase(request.Form("vcode"))<>session("vcode") then
response.write"<script language=javascript>alert('验证码错误');history.back();</Script>"
response.end
end if
if request.Form("username")="" or request.Form("password")="" or myobj.ChkLen(request.Form("username"))<3 or myobj.ChkLen(request.Form("username"))>12 or myobj.ChkLen(request.Form("password"))<6 or myobj.ChkLen(request.Form("password"))>24 or myobj.ChkID(request.Form("username"))=false then
response.write"<script language=javascript>alert('账号或密码错误');history.back();</Script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
rs.open "select * from agents where agent_id='"&request.form("username")&"'",conn,1,1
if rs.eof then
response.write"<script language=javascript>alert('该账号并不存在');history.back();</Script>"
response.end
else
if md5(request.Form("password"))<>rs("agent_pwd") then
rs.close
set rs=nothing
conn.close
set conn=nothing
response.write"<script language=javascript>alert('密码错误');history.back();</Script>"
response.end
else
response.cookies("username")=rs("agent_id")
response.cookies("password")=rs("agent_pwd")
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect ("agent_index.asp")
end if
end if
end sub
sub logout
call myobj.chkrq()
response.cookies("username")=""
response.cookies("password")=""
%>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50"> </td>
</tr>
</table>
<table width="400" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
<tr>
<td align="center" class="font1"><strong>退出代理商管理</strong></td>
</tr>
</table>
<table width="400" height="150" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
<tr>
<form name="form1" method="post" action="login.asp?action=chklogin">
<td align="center" bgcolor="#F7F7F7"><p>已经安全退出代理商管理</p>
<p><a href="login.asp">重新登陆</a></p></td>
</form>
</tr>
</table>
<%
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -