Online ASP Advanced article online Management Update--Manage page Chapter
Author: Beach Boy
The password and password verification of the article management system is described earlier. Through the password authentication can restrict the general visitor to enter the page, here wants to restrict is the ordinary user cannot enter the page, namely includes manages the page, deletes the article page, modifies the article page as well as modifies the user information and modifies the column information the page. In fact, here is the main management page and article management system page similar to the page, just added some related to the management of the content of the connection, in order to facilitate the manager of the article online modify delete operations.
The following is to introduce the main program content of this page, because it and article management of the homepage is similar, so here is just to write out its program, and annotated and the main page different places, other similar parts please refer to the Seventh section of this topic!
File manage.asp
The Open database connection
<!--#include file= "conn.asp"-->
<%
"Restrict access to unmanaged users, as described in section seventh of this topic
If Request.Cookies ("Adminok") = "" Then
Response.Redirect "Login.asp"
End If
%>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
Special Topics </title> <title>asp skills
<meta name= "generator" content= "Microsoft FrontPage 3.0" >
<link rel= "stylesheet" type= "Text/css" href= "Style.css" >
<script language= "JavaScript" >
function Popwin2 (Id,path)
{window.open ("openarticle.asp?id=" +id+ "&ppath=" +path, "", "Height=450,width=600,resizable=yes,scrollbars=yes , Status=no,toolbar=no,menubar=no,location=no ");
}
</script>
<%
Const MAXPERPAGE=18
Dim totalput
Dim currentpage
Dim totalpages
Dim i,j
If not IsEmpty (Request ("page") Then
Currentpage=cint (Request ("page")
Else
Currentpage=1
End If
Dim sql
Dim rs
Dim Rstype
Dim typesql
Dim typeid,typename
If not IsEmpty (Request ("typeID")) Then
Typeid=request ("typeID")
Else
Typeid=1
End If
Set Rstype=server.createobject ("Adodb.recordset")
Typesql= "SELECT * from type where typeid=" &cstr (typeid)
Rstype.open typesql,conn,1,1
If not rstype.eof then
Typename=rstype ("type")
End If
Rstype.close
Set rstype=nothing
%>
<body>
<div align= "center" ><center>
<table border= "0" width= "92%" cellspacing= "0" cellpadding= "0" >
<tr>
<TD width= "100%" style= Border-left:thin dotted rgb (0,128,0); Border-right:thin dotted rgb (0,128,0) "><p align=" center "><br>
Dynamic Network ASP Skills >><font color= "#FF0000" ><%response.write "" &typename& ""%></font><br >
<center>
<a href= "manage.asp?typeid=1" >asp tutorials </a>|<a href= "manage.asp?typeid=2" >ASP faq</a>|<a href= "manage.asp?typeid=3" >asp Digest </a>
|<a href= "manage.asp?typeid=4" >asp instance </a>|<a href= "manage.asp?typeid=5" >asp security </a>|
"Display System Admin page related connection, used to modify admin password name and add modify Delete column, this will be introduced in the following
<a href= "changepass.asp" title= "to modify Admin password name and add modify Delete column" ><font color=red> admin page </font></a>
<div align= "center" ><%
Sql= ' SELECT * from article where typeid= ' +cstr (typeid) + "ORDER BY data 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 ' > hasn't had any articles </p>"
Else
Totalput=rs.recordcount
Totalput=rs.recordcount
If Currentpage<1 Then
Currentpage=1
End If
if (currentpage-1) *maxperpage>totalput Then
if (totalput mod maxperpage) =0 Then
Currentpage= totalput \ Maxperpage
Else
Currentpage= totalput \ Maxperpage + 1
End If
End If
If Currentpage=1 Then
ShowPage totalput,maxperpage, "manage.asp"
Showcontent
ShowPage totalput,maxperpage, "manage.asp"
Else
if (currentPage-1) *maxperpage<totalput Then
Rs.move (currentPage-1) *maxperpage
Dim bookmark
Bookmark=rs.bookmark
ShowPage totalput,maxperpage, "manage.asp"
Showcontent
ShowPage totalput,maxperpage, "manage.asp"
Else
Currentpage=1
ShowPage totalput,maxperpage, "manage.asp"
Showcontent
ShowPage Total