if session("adminname")="" then
response.write "" & chr(13)
response.write "window.document.location.href='login.asp';"&Chr(13)
response.write "" & Chr(13)
Response.End
end if
%>
米儿文章管理系统
body {
margin-left: 0px;
margin-top: 0px;
}
-->
Function DeleFile(FilePath)
On Error Resume Next
Set Del=Server.CreateObject("Scripting.FileSystemObject")
if Err 0 Then
DelFile="该空间不支持FSO组件,无法删除文件!"
else
if InStr(FilePath, ",") > 0 then
FilePath=Split(FilePath,",")
For i = 0 to ubound(FilePath)
If Del.FileExists(Server.MapPath(FilePath))=True Then Del.DeleteFile Server.MapPath(FilePath(i)),true
Next
Else
If Del.FileExists(Server.MapPath(FilePath))=True Then Del.DeleteFile Server.MapPath(FilePath),true
End if
End if
Set Del=Nothing
End Function
id=trim(request("id"))
if id"" then
sql="delete from news where cstr(id)='"& id &"'"
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,3
newspt="../news/news_"&id&".htm"
call DeleFile("../news/news_"&id&".htm")
response.write "" & chr(13)
response.write "alert('文章删除成功!');" & Chr(13)
response.write "window.document.location.href='newslist.asp';"&Chr(13)
response.write "" & Chr(13)
Response.End
end if
%>
文章管理
ID
新闻标题
一级分类
二级分类
作者
发布时间
操作
page=clng(request("page"))
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from NEWS order by id desc"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
%>
暂时没有文章记录!
else
rs.PageSize=10
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
修改 删除
rs.movenext
if rs.eof then exit for
next
%>
response.write "首页 上一页 "
else
response.write "首页 "
response.write "上一页 "
end if
if rs.pagecount-page response.write "下一页 尾页"
else
response.write ""
response.write "下一页 尾页"
end if
response.write " 页次:"&Page&"/"&rs.pagecount&"页 "
response.write " 共"&rs.recordcount&"条记录 "&rs.pagesize&"条记录/页"
response.write " 转到:"
response.write " "
%>
end if
rs.close
set rs=nothing
%>