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

ASP
asp实现取得数组中的最大值的代码
asp 将日期格式化为需要的格式
asp 下产生任意位数随机密码的代码
asp下返回以千分位显示数字格式化的数值
asp重定向页面的方法总结
asp下去除数组中重复的项的方法
asp下实现 重新排序数字数组的代码
asp 验证输入网址是否有效并可以访问 与正则验证输入网址
asp验证Ip格式的函数
asp实现生成由数字,大写字母,小写字母指定位数的随机数
asp 格式化sql中的like字符串
asp 实现显示所有的服务器变量值的函数
asp 取得用户真实IP,对代理地址仍然有效的函数
asp 通用数据库连接过程函数
asp 字符串截取函数
asp下实现格式化文件大小以MB显示的函数
asp 下用正则表达式检测邮箱格式的函数
asp 实现检测字符串是否为纯字母和数字组合的函数
asp代码实现检测组件是否安装的函数
asp通过JMAIL实现通用发送函数

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 170 ::
收藏到网摘: 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》   
  
  至此,新闻发布系统已能投入使用,试试看,是不是很方便,很容易就能增添每
天的新闻内容了