国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

構建你的網站新聞自動發布系統之四

2019-11-18 22:19:59
字體:
來源:轉載
供稿:網友
程序處理完畢后,重新導向delete.asp這個asp文件,用以刷新新聞數據庫內的顯
示,那么每提交一條新聞資料,我們馬上可以看見執行的結果是否成功了。   
以下是delete.asp的文件內容。   
《% @language="vbscript" %》   
《%   
response.buffer=true   
Response.Expires=0   
  
%》   
《!--#include Virtual="/news/data/data.inc"--》   
《%   
  
Set rs = Server.CreateObject("ADODB.Recordset")   
sql="select * from data order by news_class ASC,news_id Desc"   
'rs.PageSize=100   
rs.open sql,conn,3,2   
  
  
%》   
《html》   
  
《head》   
《meta http-equiv="Content-Type" content="text/html;
charset=gb2312"》   
《title》新聞數據庫中所存的資料《/title》   
《meta name="GENERATOR" content="Microsoft FrontPage 3.0"》   
《style TYPE="text/CSS"》   
《!--   
lh22px {font-size:12px;line-height:22px;font-family:宋體}   
a { text-decoration: none}   
body {line-height:18px;font-size:9pt;font-family:宋體}   
td {line-height:18px;font-size:9pt;font-family:宋體}   
a:hover {color:#FF0000;text-decoration:none}   
--》   
《/style》   
《meta name="Microsoft Border" content="none"》   
《/head》   
  
《body》   
  
《form method="POST" action="delete.asp"》   
《table border="0" width="750" cellpadding="0"》   
《tr》   
《td width="750" bgcolor="#EBEBEB" colspan="2"》《div align="center"》
《center》《p》《font   
size="3"》《strong》新聞數據庫中所存的資料《/strong》《/font》《/td》   
《/tr》   
《%   
do while not rs.eof   
%》   
《tr align="center"》   
《td width="112" bgcolor="#EBEBEB"》是否刪除:《%if rs("news_delete")=-
1 then%》   
《input type="checkbox" name="《%=rs("news_id")%》"   
value="ON"》   
《%else%》   
《input type="checkbox" name="《%=rs("news_id")%》"   
value="OFF"》   
《%end if%》   
《/td》   
《td width="638" bgcolor="#FAFAFA" align="left"》《%if rs
("news_class")=1 then%》   
《font color=red》市場風云《/font》   
《%end if%》   
《%if rs("news_class")=2 then%》   
《font color=red》IT新聞《/font》   
《%end if%》   
《%if rs("news_class")=3 then%》   
《font color=red》廣州市場《/font》   
《%end if%》   
《%if rs("news_class")=4 then%》   
《font color=red》保 留《/font》   
《%end if%》   
《%if rs("news_class")=5 then%》   
《font color=red》保 留《/font》   
《%end if%》   
《%=rs("news_title")%》《/td》   
《/tr》   
《%   
rs.movenext   
loop   
%》   
《tr align="center"》   
《td width="100%" colspan="2" bgcolor="#EBEBEB"》《center》《p》
《input   
type="submit" value="提 交" name="B1"》      《input
type="reset"   
value="清 除" name="B2"》《/td》   
《/tr》   
《/table》   
《/form》   
《/body》   
《/html》   
《%   
  
if Request.ServerVariables("REQUEST_METHOD")="POST" then   
  
if not rs.bof then   
rs.movefirst   
end if   
do while not rs.eof   
n=trim(cstr(rs("news_id")))   
if request.form(n)="OFF" then   
rs.delete   
rs.update   
end if   
rs.movenext   
loop   
response.redirect "delete.asp"   
  
rs.close   
end if   
response.flush   
%》   
  delete.asp也是一個構成webadmin.htm的管理頁面的asp文件,它負責新聞數據
庫的標題顯示,以便讓您知道現在庫用有些什么新聞。同時可以通過它來刪除新聞記
錄,那么我們在使用新聞的主頁里反應出來的結果就是動態的了,新聞可以在線添加
和刪除。令外一個附加的asp程序   
set_diap.asp是用于控制每一類新聞在主頁上顯示的數目的,它主要使用
application對象來設定。   
  
《% @language="vbscript" %》   
《%   
response.buffer=true   
Response.Expires=0   
  
application("disp_1")=request.form("disp_1")   
application("disp_2")=request.form("disp_2")   
application("disp_3")=request.form("disp_3")   
application("disp_4")=request.form("disp_4")   
application("disp_5")=request.form("disp_5")     
  
response.redirect "delete.asp"   

%》   
  
  完成了上面的程序,我們的新聞發布系統就可以在線添加和刪除,設置顯示等的
功能來,需要加上搜尋功能,也可以在這個基礎上加上。下一節我們來分析,如何;
令新聞代碼嵌入不同的網頁,實現真正的在線新聞功能。  



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 东光县| 裕民县| 民乐县| 普兰店市| 灵宝市| 九台市| 济南市| 叶城县| 大方县| 南阳市| 云霄县| 德钦县| 吉林省| 赣州市| 轮台县| 横山县| 高阳县| 蒙山县| 班玛县| 孟村| 扎鲁特旗| 鹤岗市| 龙口市| 邹平县| 安义县| 高唐县| 内丘县| 马公市| 兴宁市| 高邮市| 津南区| 沈丘县| 武陟县| 沁源县| 龙游县| 田阳县| 阿坝县| 罗甸县| 衡阳县| 商南县| 会昌县|