admin_login.asp

来自「旅游管理系统 用ASP+SQL 2」· ASP 代码 · 共 122 行

ASP
122
字号
<html>
<head>
<title>管理员登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/css1.css" type="text/css">
<script id=clientEventHandlersVBS language=vbscript>
<!--

Sub lgoinok_onclick
	if form1.username.value="" then
	window.alert ("请认真填写正确的用户名!")
	form1.username.focus
	else
	if form1.password.value="" then
	window.alert ("请填写好您的密码!")
	form1.password.focus
	else
	form1.submit
	end if
	end if
End Sub

-->
</script>
</head>

<body bgcolor="#FFFFFF" style="background-color: #999999" text="#000000" topmargin="5">
<!--#include file="includefile/conn.asp" -->
<%
dim username,password,login,sort
login=request("login")
if login="go" then
username=Request("username")
password=Request("password")
sql="select * from master where username='"&username&"'"
rs.open sql,,1,1
if rs.RecordCount=0 then
Session("errormsg")="错误的用户名或密码!您无法登录。"
Response.Redirect ("error.asp")
else
if password<>rs("userpassword") then
Session("errormsg")="错误的用户名或密码!您无法登录。"
Response.Redirect ("error.asp")
else

Response.Cookies("admin")("username")=username
Response.Cookies("admin")("password")=password
session("administrator")="administrator"
session("sort")=rs("guanli")
session("longname")=rs("longname")

sort=session("sort")
if  sort <> "0" then
   Response.Redirect ("qiye_master.asp")
else
   Response.Redirect ("admin_master.asp")
end if

end if
end if
end if
%>
<!--#include file="includefile/shoubu.asp" -->
<div align="center">
  <center>
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="755" height="197" bgcolor="#FFFFFF">
    <tr>
      <td width="100%" height="197"> 
      <form name="form1" method="post" action="admin_login.asp?login=go">
  <div align="center">
    <center>
  <table width="360" border="0" cellspacing="0" cellpadding="0" height="20" bgcolor="#ADADAD">
    <tr> 
      <td align="center" class="title">登录 &nbsp;&nbsp;<a href="reg.asp">旅行社注册</a></td>
    </tr>
  </table>
    </center>
  </div>
  <div align="center">
    <center>
  <table width="360" border="0" cellspacing="0" cellpadding="0" bgcolor="#EFEFEF">
    <tr> 
      <td height="25" width="155"> 
      <p align="center"> 用户名:</td>
      <td height="25" width="205"> 
        <input type="text" name="username" size="15" class="input" value=<%=Request.Cookies("admin")("username")%>>
      </td>
    </tr>
    <tr> 
      <td height="25" width="155">
      <p align="center"> 密码:</td>
      <td height="25" width="205"> 
        <input type="password" name="password" size="15" class="input"value=<%=Request.Cookies("admin")("password")%>>
      </td>
    </tr>
    <tr align="center"> 
      <td height="25" colspan="2" width="360"> 
        <input type="button" name="lgoinok" value="登录" class="button">
           
        <input type="reset" name="Submit2" value="取消" class="button">
      </td>
    </tr>
    <tr align="center"> 
      <td height="25" colspan="2" width="360"> 
       <p align="center"><br>
      </p>
      </td>
    </tr>
    
  </table>
    </center>
  </div>
</form>

      </td>
    </tr>
  </table>
  </center>
</div>
<!--#include file="includefile/weibu.asp" -->
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?