<!--#include file="../include/conn.asp"-->
<%
'website:http://www.angelasp.com
' Angel工作室技术开发团队:QQ:815657032、QQ：709047174
' Copyright (C) Angel工作室 (http://www.angelasp.com).  All rights reserved
Dim action
action=Trim(request.QueryString("action"))
Select Case action 
Case "chklogin" 
  book_name = request.form("adminname")
  book_password = request.Form("adminpassword")
  book_code = request.Form("book_code")
If book_name = "" Then
    response.Write("<script language=javascript>alert('用户名不能为空!');history.back(1)</script>")
    response.End
End If
If book_password = "" Then
    response.Write("<script language=javascript>alert('密码不能为空!');history.back(1)</script>")
    response.End
End If
If book_code = "" Then
    response.Write("<script language=javascript>alert('验证码不能为空!');history.back(1)</script>")
    response.End
End If
If CStr(Session("GetCode"))<>CStr(book_code) Then
    response.Write("<script language=javascript>alert('验证码错误!');history.back(1)</script>")
    response.End
End If
  sql="select * from [Admin] where 1=1 and book_name='"&book_name&"'and book_password='"&book_password&"'"
  set rs=server.CreateObject("adodb.recordset")
  rs.Open sql,conn,1,1
  If Not rs.eof Then  
  session("admin_id")=rs("id")
  session("admin_name")=rs("book_name")
  rs.Close
  set rs=Nothing
  response.redirect("index.asp")       
  else  
	  response.write ("<script language='javascript'>alert('账号或密码错误?');location='login.asp';</script>")
  End If
Case "loginout"
session("admin_name")=""
response.redirect("login.asp")
End Select 
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Angel工作室留言板</title>
<style type="text/css">
body {
	margin: 0px;
	background-color: #1197E8;
	overflow:hidden;
}
.STYLE1 {
	color: #000000;
	font-size: 12px;
}
</style>
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><table background="images/index.jpg" width="899" height="508" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="235">&nbsp;</td>
        </tr>
        <tr>
          <td height="53"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="343" height="53">&nbsp;</td>
                <td width="245" ><table width="99%" border="0" cellspacing="0" cellpadding="0">
                <form method="POST" action="?action=chklogin" name="this" >
                    <tr>
                      <td width="12%" height="25"><div align="right"><span class="STYLE1">用户</span></div></td>
                      <td height="25" colspan="2"><div align="center">
                          <input type="text" name="adminname" onBlur="value=value.replace(/[^0-9a-z]/gi,'')" style="width:125px; height:17px; background-color:#292929; border:solid 1px #7dbad7; font-size:12px; color:#6cd0ff">
                        </div></td>
                      <td width="26%" height="25">&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="12"><div align="right"><span class="STYLE1">密码</span></div></td>
                      <td height="12" colspan="2"><div align="center">
                          <input type="password" name="adminpassword" style="width:125px; height:17px; background-color:#292929; border:solid 1px #7dbad7; font-size:12px; color:#6cd0ff">
                        </div></td>
                      <td height="12"><div align="left"><a href="main.html"></a></div></td>
                    </tr>
                    <tr>
                      <td height="13" align="right" class="STYLE1">验证</td>
                      <td width="30%" height="13" align="left"><input type="text" name="book_code" onBlur="value=value.replace(/[^0-9a-z]/gi,'')" style="width:55px; height:17px; background-color:#292929; border:solid 1px #7dbad7; font-size:12px; margin-left:13px; color:#6cd0ff"></td>
                      <td width="32%" align="left"><img src="code.asp" width="38" height="17" style="display:block;border:0;width:65px;height:17px;background-color:#000000;color:#fff; onclick="this.src='code.asp?key='+Math.random()"/></td>
                      <td height="13"><input name="Submit" type="image" src="images/dl.gif"></td>
                    </tr>
                    </form>
                  </table></td>
                <td width="311">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
        <tr>
          <td height="213">&nbsp;</td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>


