Using text +asp to build news release System (v) News modification

Source: Internet
Author: User
Tags chr count eval split client
' ###### #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 ("The file name after the upload cannot be empty!") "); Server.focus (); return false}
}
}

-->
</SCRIPT>
<% Dim myID
Myid=request.querystring ("id")
If Len (myID) =0 Then
Response.Write "No Such news"
Response.End
End If

Dim myfso,myread,mytext,newscontent
' ###### #打开对应的新闻内容文件, and read with variable storage
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 "This news has been deleted"
Response.End
End If

Dim mytext2,myread2 ' ###### #打开新闻列表文件
Set Myread2=myfso.opentextfile (Server.MapPath ("./new_list.asp"), 1,0)
If Myread2.atendofstream Then
Response.Write "No news content"
Response.End
End If

Mytext2=myread2.readall
Dim Listarray
Listarray=split (mytext2, "|") ' ######## #读取记录并以 # split into Listarray arrays
Dim count,sf,i,title,src
Count=ubound (Listarray)
For i=0 to count ' ########## #根据ID找到该新闻并用变量存储给新闻的标题
Sf=split (Listarray (i), ",")
If Right (SF (0), 7) =right (myid,7) Then
TITLE=SF (1)
SRC=SF (3)
Exit For
End If
Next



%>

<style>
td {FONT-SIZE:9PT}
Input.buttonface {
Background-color: #0079F2; Border-bottom: #333333 1px outset; Border-left: #333333 1px outset; Border-right:



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.