当前位置: 首页 > 图文教程 > 网络编程 > ASP > 构建你的网站新闻自动发布系统之六

ASP
对连串英文自动换行的解决方法 IE5.5
怎样写你自己的EMAIL组件(原理)
ASP中有关timeout超时的体会
用ASP实现从SQL Server导出数据到Access
ASP向NT域中加一个用户
ASP乱码的解决方法
关于 aspsmartupload 注册问题
利用XML不离开页面刷新数据
IIS 处理 SEARCH 请求漏洞
不用组件实现上载功能(1)
不用组件实现上载功能(2)
在网页中实现OICQ里的头像选择的下拉框
仅用xsl和asp实现分页功能
如何使用context()方法将数据置入表格(XML)
利用ASP从远程服务器上接收XML数据
将数据库里面的内容生成EXCEL
怎样在ASP里面创建统计图表
加密你的Access数据库
利用global.asp定时执行ASP
加密QueryString数据

ASP 中的 构建你的网站新闻自动发布系统之六


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 66 ::
收藏到网摘: n/a

  通过定制这段代码,就能制作出符合您要求的网页显示格式。   
  添加,删除,显示都讲解完了,最后一项,就是把新闻的详细内容显示出来。   
  当用户点击新闻标题,就打开disp.asp文件,同时使用GET这种方式来把参数传
递过去,我们看看disp.asp的文件内容   
  
《% @language="vbscript" %》   
《!--#include Virtual="/news/data/data.inc"--》   
《%   
Set rs = Server.CreateObject("ADODB.Recordset")   
sql="select * from data where Cstr(news_id)='"&Cstr
(request.querystring("news_id"))&"'"   
rs.open sql,conn,3,2   
%》   
《html》   
  
《head》   
《meta http-equiv="Content-Type" content="text/html;
charset=gb2312"》   
《title》《/title》   
《/head》   
  
《body topmargin="8" leftmargin="8"》   
《div align="center"》《center》   
  
《table border="0" width="600" cellpadding="0" cellspacing="0"》   
《tr》   
《td width="100%"》《/td》   
《/tr》   
《tr》   
《td width="100%" bgcolor="#E6E6E6"》《table border="0" width="100%"
cellpadding="0"》   
《tr》   
《td width="100%" bgcolor="#D2E8FF"》《p align="center"》《b》《%=rs
("news_title")%》《/b》《/td》   
《/tr》   
《tr》   
《td width="100%" bgcolor="#FBFDFF"》《table border="0" width="100%"
cellpadding="0"》   
《tr》   
《td width="100%"》《p align="right"》(update:《%=rs("news_year")%》-
《%=rs("news_month")%》-《%=rs("news_day")%》 《%=rs("news_time")%》)
《/td》   
《/tr》   
《tr》   
《td width="100%"》《p align="center"》《%   
if rs("news_pic")《》"" then   
%》 《img src="《%=rs("news_pic")%》"》 《%   
end if   
%》 《/td》   
《/tr》   
《tr》   
《td width="100%"》《div align="center"》《center》《table border="0"
width="90%" cellpadding="0"》   
《tr》   
《td width="100%"》《%=rs("news_comment")%》   
《/td》   
《/tr》   
《/table》   
《/center》《/div》《/td》   
《/tr》   
《/table》   
《/td》   
《/tr》   
《tr》   
《td width="100%" bgcolor="#D2E8FF"》《p align="center"》《a
href="javascript:window.close()"》关闭窗口《/td》   
《/tr》   
《/table》   
《/td》   
《/tr》   
《tr》   
《td width="100%"》《/td》   
《/tr》   
《tr》   
《td width="100%"》《/td》   
《/tr》   
《/table》   
《/center》《/div》《/a》   
《/body》   
《/html》   
  
  至此,新闻发布系统已能投入使用,试试看,是不是很方便,很容易就能增添每
天的新闻内容了