asp是被动执行,不能值守。你可以在发布文章的时候设定一个发布日期,在前台文章列表和文章展示页面里都加个判断日期的,如果日期小于等于now(),则显示,否则不显示。
建文章表 table_wenzhang,字段如下
id title content pubTime
1 标题1 内容1 2012-11-30 09:30:25
2 标题2 内容2 2012-11-30 15:14:37
3 标题3 内容3 2012-12-02 10:04:55
4 标题4 内容4 2012-12-04 14:12:46
5 标题5 内容5 2012-12-05 09:58:23
列表页:
set Rs=server.createObject("adodb.recordset")
Rs.open "seelect id,title,content from [table_wenzhang] where pubtime<='"&now()&"' order by pubTime desc",conn,1,1
access版
Rs.open "seelect id,title,content from [table_wenzhang] where pubtime<=#"&now()&"# order by pubTime desc",conn,1,1
文章展示页面:为了防止用户猜Id
<%
set Rs=server.createObject("adodb.recordset")
Rs.open "seelect title,content from [table_wenzhang] where id='"&request("id")&"' and pubtime<=#"&now()&"#",conn,1,1
if Rs.eof then
response.redirect "404.asp" '跳转到错误页面
elseif not Rs.eof then
%>
'显示文章内容
<html>
<head><title></title></head>
<body>文章内容</bdy>
</html>
<%
end if
Rs.close
set Rs=nothing
%>
热门信息
阅读 (107)
1 ASP+AJAX实现分页效果[Z]阅读 (107)
2 用ASP删除文件阅读 (106)
3 [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法阅读 (106)
4 ASP 微信公共平台接口实现代码阅读 (105)
5 提高IIS+ASP网站安全性的方法