动感相册下载|动感首页更新实现之五 ------ 首页管理篇

2017-08-28 新闻资讯 阅读:

   管理页同首页显示篇差不多,这里阿喔只介绍如何连接删除链!
'见尾页
<%
if request.cookies("adminok")="" then
response.redirect "login.asp"
end if
%>




 

管理文件

 

 



<%
const MaxPerPage=40
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j

if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if

%>

&nbsp;













<%do while="" not="">






<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>



管 理 界 面








<%
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 "
还 没 有 任 何 文 章
"
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
showpages
showContent
showpages
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpages
showContent
showpages
else
currentPage=1
showpages
showContent
showpages
end if
end if
rs.close
end if

set rs=nothing
conn.close
set conn=nothing


sub showContent
dim i
i=0

%>
<table border="1" cellspacing="0" width="90%" bgcolor="#F0F8FF" bordercolorlight="#000000"
bordercolordark="#FFFFFF" align="center">







ID 号
主 题
时 间
删 除


<%=rs("articleid")%>




<%=rs("title")%>




<%=rs("dateandtime")%>


<a
href="delete.asp?id=<%=rs("articleid")%>">删 除

 

<%
end sub

sub showpages()
dim n
if (totalPut mod MaxPerPage)=0 then
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
if n=1 then
response.write "

创建文章"
response.write "

"
exit sub
end if

dim k
response.write "

&gt;&gt; 文章分页 "
for k=1 to n
if k=currentPage then
response.write "["+Cstr(k)+"] "
else
response.write "["+""+Cstr(k)+"] "
end if
next
response.write " 创建文章"
response.write "

"
end sub


%>


 

 

《ASP动感在线》编辑制作

 

 






大家注意的是:
删 除
关系者要删除内容的位置,要不然KILL错了就麻烦了!

动感相册下载|动感首页更新实现之五 ------ 首页管理篇

http://m.hzclsc.cn/anzhuo/1514.html

推荐访问:动感相册 动感101

新闻资讯推荐文章

推荐内容

上一篇:美篇访问统计 其他_完整的访问统计程序(二 程序篇) 下一篇:[怎么用asp实现分页显示]怎么用ASP实现分页(一)