通知发布系统

      ASP 2005-5-28 15:44:00
这几天为某单位做一网站,要用到通知发布系统,正好又看了老闪zjs35的相关日志,于是比葫芦画瓢做了一个。。。

news_add.asp

<%
userexist=0
news_title=Request.form("news_title")
news_file=Request.Form("news_file")
news_publisher=Request.Form("news_publisher")
news_publish_time=Request.Form("news_publish_time")
set conn = server.createobject("adodb.connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("news.mdb")
set rs = server.createobject("adodb.recordset")
rs.open "news1",conn,1,3
while not rs.eof
'While 循环语句,这里是条件,当记录集没有空时,执行后边的语句。

if (news_title=rs("news_title") and news_file=rs("news_file") and news_publisher=rs("news_publisher") and news_publish_time=rs("news_publish_time")) then
response.Write "<p align=center>&nbsp;</p>"

response.Write "<P align=center><FONT color=black size=2>此通知已发布,请重新发布。。。</FONT></P>"
userexist=1
end if
rs.MoveNext
wend
if userexist=0 then
rs.addnew
rs("news_title") = news_title
rs("news_file")=news_file
rs("news_publisher")=news_publisher
rs("news_publish_time")=news_publish_time
rs.update
set rs = nothing
set conn = nothing
response.Write "<p align=center>&nbsp;</p>"

response.Write "<P align=center><FONT color=black size=2>提交成功,请返回。。。</FONT></P>"

end if



%>

<head>
<title></title>
</head>

<body bgcolor="#cccccc">

<p align="center">&nbsp;</p>
<p align="center"> </p>

<p align="center"><embed width="341" height="264" src="news_add_finished.swf" align="baseline" style="HEIGHT: 29px; WIDTH: 114px"></p></body></HTML>





news_add.fla

提交按钮AS:

on(release){
if(_root.news_title=="" or _root.news_title=="标题不能为空,请重新输入..." or _root.news_title=="请输入标题" ){
_root.news_title="标题不能为空,请重新输入..." }
else if(_root.news_file=="" or _root.news_file=="请输入文件名" or _root.news_file=="文件名不能为空..."){
_root.news_file="文件名不能为空..."}

else{
getURL("news_add.asp","","POST")
}
标签集:TAGS:
回复Comments() 点击Count()
喜欢就顶一下

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}
深度XP 雨林木风XP WinXP下载 世界之窗 深度系统 雨林木风 Ghost ghost系统盘 XP下载