www.gusucode.com > 栽豆迷你博客 MiniBlog 3.0 正式版源码程序 > Admin_Login.asp

    <!--#include file="include/conn.asp" -->
<!--#include file="include/const.asp" -->
<!--#include file="include/cb_admin.asp" -->
<!--#include file="include/md5.asp" -->
<!--#include file="include/Function.asp" -->
<%
Dim Admin:Set Admin = new admin_main
Dim asp:asp=Request("asp")
Select Case asp
Case "login"
Dim adminame,password,inspect
adminame=CheckStr(Request.Form("adminame"))
password=md5(CheckStr(Request.Form("password")))
inspect=ValidInteger(Request.Form("inspect"))
If inspect<>Trim(Caluoob.CheckNum("n1")+Caluoob.CheckNum("n2")) then Caluoob.ShowErr("效验错误!")
Dim myrs:Set myrs=Caluoob.Execute("select usernames,passwords from cb_admin where usernames='"&adminame&"' and passwords='"&password&"'")
	If not(myrs.eof and myrs.bof) then
		Caluoob.LogString
		Response.Cookies(CookieName&"CaluoobAdmin")("AdminName") = myrs(0)
		Response.Cookies(CookieName&"CaluoobAdmin")("AdminWord")= left(myrs(1),16)
		Response.Redirect "Admin_main.asp"
	Else
		Caluoob.ShowErr("请确认帐户数据是否正确。")
	End if
myrs.close:Set myrs=nothing
Case "exit"
	Response.Cookies(CookieName&"CaluoobAdmin")("AdminName") = ""
	Response.Cookies(CookieName&"CaluoobAdmin")("AdminWord")= ""
	Session("n1")=False:Session("n2")=False'消除验证码
	Response.Redirect "Admin_Login.asp"
Case else
 If Admin.Administrator=False Then
%>
<!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=gb2312">
<title>后台管理登陆</title>
<link rel="stylesheet" rev="stylesheet" href="skins/admin/default.css" type="text/css" media="all" />
</head>
<body>
<div class=wtablel>
<div class=wtable_name>后台管理登陆</div>
  <div class=wtable_cont>
    <table border="0" align="center" cellpadding="5" cellspacing="0">
    <form method="post" action="?asp=login">
      <tr>
        <td width="50">帐&nbsp;&nbsp;户:</td>
        <td width="100"><input name="adminame" type="text" id="adminame" /></td>
      </tr>
      <tr>
        <td width="50">密&nbsp;&nbsp;码:</td>
        <td width="100"><input name="password" type="password" id="password" /></td>
      </tr>
      <tr>
        <td width="50">验证码:</td>
        <td width="100" style="font-family:Arial,宋体;"><input name="inspect" type="text" size="2" maxlength="2" /> = <%=Caluoob.CheckNum("n1")&"+"&Caluoob.CheckNum("n2")%></td>
      </tr>
      <tr>
        <td width="50"></td>
        <td><input type="submit" name="Submit" value="提交" />&nbsp;&nbsp;<input type="reset" name="Submit" value="重置" /></td>
      </tr>
      </form>
    </table>
  </div>
</div>
</body>
</html>
<%
 Else
 Response.Redirect("admin_mian.asp")
 End If
End Select
%>