三度网教程:是一个免费提供流行视频软件教程、在线学习分享的学习平台!

用文本+ASP打造新闻公布系统(5)新闻更改

时间:2024-2-19作者:未知来源:三度网教程人气:


‘#######news_update.asp
<!--#include file="news_session.asp"-->

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function client_onblur(ii) {
server=eval("form1.server"+ii)
if(server.value==""){
client=eval("form1.client"+ii)
clientvalue=client.value+""
varlen=clientvalue.length
a=clientvalue.lastIndexOf('\\')
clientvalue=clientvalue.substring(a+1)
//alert(clientvalue);
server.value=clientvalue
}
}
function form1_onsubmit() {
for(i=1;i<1;i++){
client=eval("form1.client"+i)
server=eval("form1.server"+i)
if(client.value!="" && server.value==""){alert("上传后的文件名不能空!");server.focus();return false}
}
}

//-->
</SCRIPT>
<% dim myid
myid=Request.QueryString ("id")
if len(myid)=0 then
Response.Write "没有该新闻"
Response.End
end if

dim myfso,myread,mytext,newscontent
'#######打开对应的新闻内容文件,并读取用变量存储
set myfso=createobject("scripting.filesystemobject")
if myfso.FileExists (server.mappath("./news_content/"&myid&".txt")) then
set myread=myfso.opentextfile(server.mappath("./news_content/"&myid&".txt"),1,0)

newscontent=myread.readall
myread.close
newscontent=replace(newscontent,"<br>",chr(13))
newscontent=replace(newscontent," "," ")
newscontent=replace(newscontent," ",chr(32))
newscontent=replace(newscontent,"'' ",chr(34))

else
Response.Write "该新闻已被删除"
Response.End
end if

dim mytext2,myread2 '#######打开新闻列表文件
set myread2=myfso.opentextfile(server.mappath("./new_list.asp"),1,0)
if myread2.atendofstream then
Response.Write "没有新闻内容"
Response.End
end if

mytext2=myread2.readall
dim listarray
listarray=split(mytext2,"

关键词:  用文本+ASP打造新闻公布系统(5)新闻更改





Copyright © 2012-2018 三度网教程(http://www.3du8.cn) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版