<!--#include file="../conn/conn2.asp" -->
<!--#include file="../conn/function.asp" -->
<%Server.ScriptTimeout=999%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台登录</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body class="login">
<%
call cms_update()
action=Request.QueryString("action")
if action="login" then
username=Replace_Text(Request.Form("username"))
pwd=Replace_Text(Request.Form("pwd"))
sql="Select * from SL_admin Where A_login='"&username&"' and A_pwd='"&md5(pwd)&"'"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
session("A_user")=username
session("A_pass")=md5(pwd)
session("set_login")=""
session("set_pwd")=""
session.timeout=50000

Response.Write"<script>if (self.frameElement && self.frameElement.tagName == 'IFRAME') {window.location='page.asp?page=index2.asp';}else{window.location='index.asp';}</script>"
response.End()
else
call box("用户名或密码错误!","back","error")
end if
rs.close
set rs=nothing
end if

if action="unlogin" then
session("A_user")=""
session("A_pass")=""
call box("退出成功!","admin_login.asp","success")
end if

sql="select * from config"
		set rs=Server.CreateObject("ADODB.RecordSet")
		rs.open sql,conn,1,1
		if not rs.eof then
		title=rs("C_title")
		end if
rs.close
set rs=nothing

%>
<form action="admin_login.asp?action=login" method="post">
<div class="login_m">
	<div class="login_logo"><img src="<%=C_dir%><%=C_logo%>" width="200"></div>
	<div class="login_boder">
		<div class="login_padding">
			<h2>用户名</h2>
			<label>
				<input type="text" id="username" name="username" class="txt_input txt_input2" onfocus="if (value ==&#39;请输入用户名&#39;){value =&#39;&#39;}" onblur="if (value ==&#39;&#39;){value=&#39;请输入用户名&#39;}" value="请输入用户名">
			</label>
			<h2>密码</h2>
			<label>
				<input type="password" name="pwd" id="userpwd" class="txt_input" onfocus="if (value ==&#39;******&#39;){value =&#39;&#39;}" onblur="if (value ==&#39;&#39;){value=&#39;******&#39;}" value="******">
			</label>
			<p class="forgot"><a href="found.asp">忘记密码?</a></p>
			<div class="rem_sub">
				<label>
					<input type="submit" class="sub_button" name="button" id="button" value="登录" style="opacity: 0.7;">
				</label>
			</div>
		</div>

	</div><!--login_boder end-->
			<%if session("set_login")<>"" and session("set_pwd")<>"" then%><div style=" padding:10px; border:#999999 dashed 2px; text-align:center;">用户名：<%=session("set_login")%>  密码：<%=session("set_pwd")%>（本提示框仅首次设置后出现）</div><%end if%>
</div><!--login_m end-->
</form>
<br />
<br />

</body>
</html>