<%
dim sql
dim rs
dim seekerrs
dim founduser
dim username
dim companyid
dim password
dim errmsg
dim founderr
founderr=false
FoundUser=false
username=request.form("username")
password=request.Form("password")
if username="" then
response.redirect "index.asp"
end if
if password="" then
response.redirect "index.asp"
end if
if username="admin" and password="admin" then
response.cookies("adminok")=true
response.redirect "manage.asp"
else
response.redirect "index.asp"
end if
%>
5.1.3管理后台页
Manage.asp页面示例
图为管理员登陆录成功后所看到的页面效果。
页面中需要用户添写HTML的表单元素
此页面无需填写HTML表单元素
页面所涉及的数据库表信息
此页使用了系统中的信息记录表learning.
4.页面代码分析
<%
if request.cookies("adminok")="" then
response.redirect "login.asp"
end if
%>
<!--#include file="articleconn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理文件</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<link rel="stylesheet" href="css/article.css">
</head>
<%
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<body bgcolor="#FFFFFF">
<p> </p>
<table width="700" border="1" cellspacing="0" cellpadding="0" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr bgcolor="#99CCFF">
<td height="10" bgcolor="#3399cc">
<div align="center"><b>管 理 界 面</b></div>
</td>
</tr>
<tr>
<td height="49"><%
dim sql
dim rs
sql="select * from learning order by articleid desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'> 还 没 有 任 何 信 息</p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
&n