<!--#include file="inc/conn.asp"-->
<!--#include file="inc/inc.asp"-->
<!--#include file=inc/ipt.asp-->
<%if request("cnmai")="out" then
Response.cookies("cnmai")=""
Response.Redirect "index.asp"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=title%>-会员登陆</title>
<SCRIPT language=javascript>
<!--
function CheckloginForm()
{
if(document.thisForm.username.value.length<1)
	{
	    alert("登陆帐号没有填写!");
	    return false;
	}
if(document.thisForm.password.value.length<1)
	{
	    alert("密码没有填写正确!");
	    return false;
	}
}

//-->
</SCRIPT>
</head>
<body topmargin="0">
<%call t()%><DIV class=h></DIV>
<div align="center">
<table width="760" id="table1" style="padding:1px; border-collapse:collapse" cellpadding="0">
<tr>
<td width="700" class="td" valign="top">
<%
if request("login")="cnmai" then

dim rsper,sqlper,rscom,sqlcom,k,per
per=Request.form("per")
m=Request.form("m")
if request.cookies("cnmai")("errs")="" then
k=0
else
k=request.cookies("cnmai")("errs")
end if
if request.cookies("cnmai")("errs")>5 then
Response.Write "<script language='javascript'>alert('您登陆的次数过多,系统保护中！');history.back();</script>" 
response.end
end if
username=replace(trim(request("username")),"'","‘")
password=md5(replace(trim(request("password")),"'","‘"))
chkcnmai(username)
if nothaveChinese(username)=false then
Response.Write "<script language='javascript'>alert('用户名为非中文');history.back();</script>" 
end if

if per<>"" then
set rsper=server.createobject("adodb.recordset")
sqlper="select * from [jle_user] where username='"&UserName&"' and password='"&password&"'"
rsper.open sqlper,conn,1,3
if rsper.eof then
Response.cookies("cnmai")("errs")=k+1
Response.Write "<script language='javascript'>alert('您的用户名或密码不正确！');history.back();</script>" 
response.end
else
rsper("lasttime")=now()
rsper("jf")=rsper("jf")+jf_3
rsper("dlcs")=rsper("dlcs")+1
userip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip="" Then 
userip=Request.ServerVariables("REMOTE_ADDR")
end if
rsper("ip")=userip
rsper.update
Response.cookies("cnmai")("username")=rsper("username")
Response.cookies("cnmai")("domain")=Request.ServerVariables("SERVER_NAME")
Response.cookies("cnmai")("per")=rsper("username")
Response.cookies("cnmai")("vip")=rsper("vip")
Response.cookies("cnmai")("id")=rsper("id")
end if
Response.Redirect "user.asp"
rsper.close
set rsper=nothing
closedb

else

set rscom=server.createobject("adodb.recordset")
sqlcom="select * from [jle_com] where UserName='"&UserName&"' and password='"&password&"'"
rscom.open sqlcom,conn,1,3
if rscom.eof then
Response.cookies("cnmai")("errs")=k+1
Response.Write "<script language='javascript'>alert('您的用户名或密码不正确！');history.back();</script>" 
response.end
else
rscom("lastdl")=now()
rscom("jf")=rscom("jf")+jf_3
rscom("dlcs")=rscom("dlcs")+1
userip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip="" Then 
userip=Request.ServerVariables("REMOTE_ADDR")
end if
rscom("ip")=userip
rscom.update
Response.cookies("cnmai")("username")=rscom("username")
Response.cookies("cnmai")("com")=rscom("com")
Response.cookies("cnmai")("vip")=rscom("vip")
Response.cookies("cnmai")("comyz")=rscom("yz")
Response.cookies("cnmai")("domain")=Request.ServerVariables("SERVER_NAME")
Response.cookies("cnmai")("id")=rscom("id")
end if
Response.Redirect "com_user.asp"
rscom.close
set rscom=nothing
closedb
end if

else
%>
<form id="f1" name="thisForm" action="Login.asp" method="POST" style="line-height: 100%; margin-top: 0; margin-bottom: 0">
<div align="center">
<table width="100%" cellpadding="0" style="border-collapse: collapse" id="table8" height="115%" ><tr>
<td class=td1 colspan="2">&nbsp;位置导航：<a href="/">首页</a>→会员登陆管理</tr>
<tr>
<td class=tdh rowspan="7" width="14%">　</tr>
<td height="33" align="center" width="86%">　</tr>
<tr>
<td height="33" align="center" width="86%">登陆帐号：<input id="username2" maxLength="20" size="19" name="username"></tr>
<tr>
<td height="33" align="center" width="86%">登陆密码：<input id="password2" type="password" maxLength="32" size="19" name="password"></tr>
<tr>
<td height="31" width="86%"><p align="center">&nbsp;&nbsp;<input type="hidden" name="login" value="cnmai"><input  onclick="javascript:return CheckloginForm();" type="submit" value="商家登陆" name="m" style="font-size: 10pt; ">
<input onclick="javascript:return CheckloginForm();" type="submit" value="个人登陆" name="per"> </td></tr><tr>
<td height="25" align="center" width="86%">
<a href="reg.asp">注册新会员</a>　<a href="getpass.asp">找回密码</a></td></tr><tr>
<td height="21" width="86%">
<p align="center"><a href="fabu.asp?cnmai=free"><font color=red>
我是游客,我要马上发布信息>>>点这里进入</font></a><font color="#999999">(不用注册,但所发信息需要审核通过)</font></td></tr><tr>
<td width="86%">
　</td></tr></table>
</div>
</form>
<%end if%></td>
<td valign="top">
<img border="0" src="image/login1.gif"></td>
<td width="250" class="td">
　</td>
</tr>
</table>
</div>
<!--#include file="foot.asp"-->
</body>
</html>
