📄 login.asp
字号:
<%response.Buffer = true%>
<!--
版本:草原二手市场V1.1
本程序作者:mysql QQ:54016224 TEL:13036133798
-->
<!--#include file="include/conn.asp"-->
<!--#include file="include/function.asp"-->
<!--#include file="include/md5.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="css/css.css" rel=stylesheet>
<SCRIPT language="javascript" src="js/login.js"></SCRIPT>
<title>登陆页面</title>
<script language=javascript>
function window.onload()
{
if(top.location != self.location)
{
var a = window.parent.document.getElementsByTagName('iframe');
for (var i=0; i<a.length; i++)
{
if (a[i].name == self.name)
{
a[i].height = document.body.scrollHeight;
a[i].width = document.body.scrollWidth;
return;
}
}
}
}
</script>
</head>
<body bgcolor="#F0F9FB" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
if toValidChar(request("action")) = "login" then
'判断验证码
if trim(request("validateCode")) <> trim(session("verifycode")) then
Response.Write "<script Language=Javascript>alert('请输入正确的验证码!');history.back();</script>"
response.end
end if
username = toValidChar(request.form("username"))
userpass = md5(toValidChar(request.form("userpass")))
sql = "select * from [User] where UserName = '"&username&"' and UserPwd = '"&userpass&"'"
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof and not rs.bof then
Randomize
random = rnd*9999
response.Cookies("check") = md5(rs("UserName")&rs("UserPwd")&random)
response.Cookies("UserName") = rs("UserName")
response.Cookies("UserPwd") = rs("UserPwd")
response.Cookies("UserID") = rs("UserID")
response.Cookies("Random") = random
%>
<%end if
end if%>
<%
UserName = request.Cookies("UserName")
UserPwd = request.Cookies("UserPwd")
Random = request.Cookies("Random")
check = request.Cookies("check")
if md5(UserName&UserPwd&Random) <> check then
%>
<table width="218" border="0" cellspacing="3" cellpadding="0" bgcolor="#F0F9FB">
<FORM name=loginform action="login.asp?action=login" method=post>
<tr>
<td width="66" align="right" class="font-14px120-000000">用户名:</td>
<td colspan="3"> <table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/e_pic_inputincept.gif" width="5" height="22"></td>
<td valign="bottom" background="images/e_pic_inputbg.gif" bgcolor="#FFFFFF">
<input name="username" value="" type="text" class="input-0px-14px100-000000" style="width:134">
</td>
<td><img src="images/e_pic_inputend.gif" width="5" height="22"></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" class="font-14px120-000000">密 码:</td>
<td colspan="3"> <table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/e_pic_inputincept.gif" width="5" height="22"></td>
<td valign="bottom" background="images/e_pic_inputbg.gif" bgcolor="#FFFFFF">
<input name="userpass" type="password" class="input-0px-14px100-000000" style="width:134">
</td>
<td><img src="images/e_pic_inputend.gif" width="5" height="22"></td>
</tr>
</table></td>
</tr>
<tr>
<td align="right" class="font-14px120-000000">验证码:</td>
<td width="45"> <table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/e_pic_inputincept.gif" width="5" height="22"></td>
<td valign="bottom" background="images/e_pic_inputbg.gif" bgcolor="#FFFFFF">
<input name="validateCode" type="text" class="input-0px-14px100-000000" id="validateCode" style="width:35" maxlength="4">
</td>
<td><img src="images/e_pic_inputend.gif" width="5" height="22"></td>
</tr>
</table></td>
<td width="42"> <table width="42" border="0" cellpadding="0" cellspacing="1" bgcolor="#FF6600">
<tr>
<td height="20" align="center" bgcolor="#FFCC00"><img src="include/num.asp"> </td>
</tr>
</table></td>
<td width="50"> <input name="subhere" type="image" src="images/e_button_login.gif" alt="" width=50 height=24 border="0">
</td>
</tr>
</form>
</table>
<%else%>
<table width="218" height="85" border="0" cellpadding="2" cellspacing="2" bgcolor="#F0F9FB">
<tr>
<td width="50%" class="font-14px120-000000">欢迎你</td>
<td width="50%" class="font-14px120-000000"><%=request.Cookies("UserName")%></td>
</tr>
<tr>
<td class="font-14px120-000000"><a href="myinfo.asp" target="_parent">发布信息</a></td>
<td class="font-14px120-000000"><a href="p_box.asp" target="_parent">短信信箱</a></td>
</tr>
<tr>
<td class="font-14px120-000000"><a href="p_letter.asp" target="_parent">写小纸条</a></td>
<td class="font-14px120-000000"><a href="logout.asp" target="_self">退出登陆</a></td>
</tr>
</table>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -