<%
'商易仿淘宝4.0(多用户)
'ACCESS版演示网站：http://www.ftaobao.com(商易仿淘宝商城)
'SQL版演示网站：http://sql.ftaobao.com
'电话：0571-56907100
'QQ：1147100
%>
<!--#include file="../include/conn.asp" -->
<!--#include file="../include/md5.asp" -->
<%
'商易仿淘宝4.0.1演示地址
'http://www.ftaobao.com
'禁止网页缓存
Response.Buffer = True 
Response.ExpiresAbsolute = Now() - 1 
Response.Expires = 0 
Response.CacheControl = "no-cache"
'判断是否使用了代理
if Request.ServerVariables("HTTP_X_FORWARDED_FOR") = ""  then
ip=Request.ServerVariables("REMOTE_ADDR")
else
ip=Request.ServerVariables("HTTP_X_FORWARDED_FOR")
end if

if request("login")="yes" then
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if not mid(server_v1,8,len(server_v2))=server_v2 then
Response.Write "<script language=JavaScript>{window.alert('系统错误，拒绝从非本服务器登陆!');window.history.go(-1);}</script>"
response.end
end if


adminname=shopnet("name")
adminpass=md5(shopnet("pass"))
yz=shopnet("yz")
ok=(session("ok"))


if not yz=ok then
Response.Write "<script>alert(""填入的验证码错误，请重新输入。"");location.href=""adminlogin.asp"";</script>"
response.end
end if

set rs=server.createobject("adodb.recordset")
sql="select adminname,adminpass,qx from admin where adminpass='"&adminpass&"' and adminname='"&adminname&"'"
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
if adminname=rs("adminname") and adminpass=rs("adminpass") then
Set rs2 = Server.CreateObject("ADODB.Recordset")
sql2="select * from ip "
rs2.open sql2,conn,1,3
rs2.addnew
rs2("name")=rs("adminname")
rs2("ip")=ip
'rs2("win")=Request.ServerVariables("HTTP_USER_AGENT")
rs2.update
rs2.close
set rs2=nothing
Session.Contents.Remove("js")
Session.Contents.Remove("ok")
session("rikee.com")=rs("adminname")
session("qx")=rs("qx")
Response.Cookies("UserName")=shopnet("name")
Response.Cookies("Userpass")=adminpass
Response.Cookies("eremite")="0"
Response.Redirect "admin.asp"
else
call Error
end if
else
call Error()
end if

sub Error()
response.write "<script>alert(""用户名或密码错误，请检查！"");location.href=""adminlogin.asp"";</script>"
end sub
rs.close
conn.close
set rs=nothing
set conn=nothing

Response.end
end if%>
<HTML><HEAD><TITLE>商易仿淘宝商城登录系统</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>.font1 {
	FONT-SIZE: 12px; LINE-HEIGHT: 130%; FONT-FAMILY: "宋体"
}
A {
	FONT-SIZE: 12px; FONT-FAMILY: "宋体"
}
A:link {
	FONT-SIZE: 12px; COLOR: #6262b1; TEXT-DECORATION: none
}
A:visited {
	FONT-SIZE: 12px; COLOR: #6262b1; TEXT-DECORATION: none
}
A:hover {
	FONT-SIZE: 12px; COLOR: #ffffff; TEXT-DECORATION: underline
}
.input {
	BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; FONT-SIZE: 12px; BORDER-LEFT: #000000 1px solid; COLOR: #000000; BORDER-BOTTOM: #000000 1px solid; FONT-FAMILY: "宋体"; BACKGROUND-COLOR: #ffffff
}
</STYLE>


<META content="MSHTML 6.00.3790.536" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#002779 leftMargin=0 topMargin=0 marginheight="0" 
marginwidth="0">
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD vAlign=center align=middle>
      <TABLE cellSpacing=0 cellPadding=0 width=460 border=0>
        <TBODY>
        <TR>
          <TD><IMG height=23 src="images/login_1.jpg" 
        width=190></TD>
        </TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=460 border=0>
        <TBODY>
        <TR>
          <TD><IMG height=142 src="images/login_2.jpg" 
        width=460></TD>
        </TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=460 border=0>
        <TBODY>
        <TR>
          <TD bgColor=#eeeeee height=6></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=460 border=0>
        <TBODY>
        <TR>
          <TD align=middle bgColor=#ffffff height=120>
            <TABLE cellSpacing=0 cellPadding=0 width=372 align=center 
              border=0><form name="form" method="post" action="?login=yes">
              <script language="javascript">
	<!--//
	function checksignup() {
		if ( document.form.name.value == '' ) {
			window.alert('请输入管理账号!!');
			document.form.name.focus();
		}
		else if ( document.form.pass.value == '' ) {
			window.alert('请输入管理账号密码!!');
			document.form.pass.focus();
		}
		else if ( document.form.yz.value == '' ) {
			window.alert('请输入右边显示的5位数的验证码!');
			document.form.yz.focus();
		}
       else {
		return true;
			}
		return false;
	}
	//-->
	          </script><TBODY>
              <TR>
                <TD align=middle colSpan=3 height=5></TD></TR>
              <TR>
                <TD class=nwes width=95 height=36></TD>
                <TD class=font1 width=52 height=36>用户名</TD>
                <TD width="225"> <input class=input name="name" type="password" id="name" size="15" maxlength="20"> </TD></TR>
              <TR>
                <TD class=nwes height=36>&nbsp; </TD>
                <TD class=font1 height=36>口　令</TD>
                <TD><input class=input name="pass" type="password" id="pass" size="15" maxlength="20"> </TD></TR>
           
                <TD height="36">&nbsp;</TD>
                <TD class=font1 align=middle>验证码&nbsp;&nbsp; </TD>
                <TD> <INPUT class=input name="yz" id="yz" size="15" maxLength=5>
				
                  <img src="code.asp" alt="登陆验证码" border="0" align="absmiddle" /></TD>
              </TR>   <TR>
                <TD colSpan=3 height=5></TD></TR>
              <TR>
              <TR>
                <TD>&nbsp; </TD>
                <TD align=middle>&nbsp; </TD>
            <TD><input class=input type="submit" name="Submit" value="登录" onClick="return checksignup()" onFocus="this.blur()">
            &nbsp;&nbsp;&nbsp;&nbsp; <input class=input type="reset" name="Submit2" value="重置"></TD></TR></FORM></TBODY></TABLE></TD></TR></TBODY></TABLE>
      <TABLE cellSpacing=0 cellPadding=0 width=460 bgColor=#ffffff border=0>
        <TBODY>
        <TR>
          <TD><IMG height=10 src="images/login_3.gif" width=10></TD>
          <TD align=right><IMG height=10 src="IMAGES/login_4.gif" 
          width=10></TD>
        </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

</BODY></HTML>
