📄 editzhai.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="char.asp"-->
<!--#include file="include/function.asp"-->
<!--#include file="include/setup.asp"-->
<!--#include file="head.asp"-->
<table border="0" width="60%" cellspacing="0" cellpadding="3" id="table2">
<tr>
<td width="935" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="4" id="table3">
<tr>
<td class="title">修改网摘</td>
</tr>
<tr>
<td>
<%
id=cint(request.querystring("id"))
set rs=conn.execute("select * from zhai where UserID='"&userid&"' and id="&id)
if not rs.eof then
Title=rs("title")
FromURL=rs("FromURL")
Intro=rs("Intro")
Sort=rs("Sort")
XSort=rs("XSort")
IsPub=rs("IsPub")
Img=rs("Img")
HtmUrl=rs("HtmUrl")
filepath=rs("filepath")
else
response.write"<SCRIPT language=JavaScript>alert('对不起,请不要非法修改她人的数据,您的IP已被我们记录,请返回!');"
response.write"javascript:history.go(-1);</SCRIPT>"
response.end
end if
rs.close
zt=trim(request("zt"))
if zt="edit" then '保存
id=cint(request("id"))
Title=HTMLcode(trim(Request.Form("Title")))
FromURL=HTMLcode(Trim(Request.Form("FromURL")))
Review=""
Intro=HTMLEncode(Trim(Request.Form("Intro")))
Sort=HTMLcode(Trim(Request.Form("Sort")))
set rssort=conn.execute("select Sortid,SortName from sort where Sortid='"&sort&"'")
sortname=rssort("SortName")
rssort.close
Rank=HTMLcode(Trim(Request.Form("Rank")))
IsPub=Trim(Request.Form("IsPub"))
Img=HTMLcode(Trim(Request.Form("Img")))
XSort=HTMLcode(Trim(Request.Form("XSort")))
set rsmb=server.createobject("ADODB.recordset")
rsmb.Open "mb",conn,1,1
mbcontent=rsmb("mb")
rsmb.close
path="article/"&filepath
pencat=mbcontent
set rsadd=server.createobject("ADODB.recordset") '写入数据
Application.Lock()
rsadd.Open "select * from zhai where id="&id,conn,3,3
rsadd("Title")=Title
rsadd("FromURL")=FromURL
rsadd("Intro")=Intro
rsadd("Sort")=Sort
rsadd("IsPub")=IsPub
rsadd("Img")=Img
if XSort<>"" then
rsadd("XSort")=XSort
end if
rsadd.Update
ID=rsadd("ID")
HtmUrl=rsadd("HtmUrl")
rsadd.close
dddd = year(now()) & "年" & month(now()) & "月" & day(now()) & "日" & hour(now())&":"&minute(now())
pencat=replace(pencat,"HtmTitle",title)
pencat=replace(pencat,"HtmGjz",XSort)
pencat=replace(pencat,"HtmUpdate",dddd)
pencat=replace(pencat,"HtmContent",Intro)
pencat=replace(pencat,"栏目",sortname)
pencat=replace(pencat,"sdfsdf",sort)
pencat=replace(pencat,"HtmUrl",FromURL)
pencat=replace(pencat,"原文地址",FromURL)
pencat=replace(pencat,"Htmfname",fname)
pencat=replace(pencat,"网摘编号",id)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.folderexists(server.mappath(path)) then
dd=1
else
Set fout1 = fso.CreateFolder(server.mappath(path))
end if
filename=path&"/"&HtmUrl
if fso.fileexists(server.mappath(filename)) then
fso.DeleteFile(server.mappath(filename))
Set fout = fso.CreateTextFile(server.mappath(filename))
fout.WriteLine pencat
else
Set fout = fso.CreateTextFile(server.mappath(filename))
fout.WriteLine pencat
end if
fout.close
set fso=nothing
response.redirect "myzhai.asp"
response.end
end if
%>
<br>
<div align="center">
<form method="POST" action="editzhai.asp?zt=edit&id=<%=id%>" name="formadd">
<table border="1" width="95%" cellspacing="0" cellpadding="3" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" id="table2">
<tr height =30>
<td bgcolor="#EAEAEA" width="80">
标 题:</td>
<td width="451" align="left" bgcolor="#EAEAEA">
<input
name=Title id="Title" style="width: 389; height:22" size=40 value="<%=title%>"></td>
</tr>
<tr height =30>
<td bgcolor="#EAEAEA" width="80">
网 址:</td>
<td width="451" align="left" bgcolor="#EAEAEA">
<input
name=FromURL id="FromURL" style="width: 390; height:22" size=40 value="<%=FromURL%>"></td>
</tr>
<tr height =30>
<td bgcolor="#EAEAEA" width="80">
简 介:</td>
<td width="451" align="left" bgcolor="#EAEAEA">
<textarea name="Intro" cols=39 rows=4 id="Intro" style="width: 390; height:234"><%=Intro%></textarea></td>
</tr>
<tr height =30>
<td bgcolor="#EAEAEA" width="80">
图 片:</td>
<td width="451" align="left" bgcolor="#EAEAEA">
<input
name=Img id="Title0" style="width: 280px" size=40 value="<%=Img%>"></td>
</tr>
<tr height =30>
<td bgcolor="#EAEAEA" width="80">
分 类:</td>
<td width="451" align="left" bgcolor="#EAEAEA">
<select name="Sort" id="Sort">
<%
set rs=conn.execute("select sortid,SortName from sort order by sortid asc")
do while not rs.eof
%>
<option value=<%=rs("sortid")%> <%if cint(sort)=cint(rs("sortid")) then response.write " selected"%>><%=rs("SortName")%></option>
<%
rs.movenext
loop
rs.close
%>
</select></td>
</tr>
<tr height =30>
<td bgcolor="#EAEAEA" width="80">
关 键 字:</td>
<td width="451" align="left" bgcolor="#EAEAEA">
<input
name=XSort id="Title1" style="width: 112; height:18" size=40 value="<%=XSort%>"></td>
</tr>
<tr height =30>
<td bgcolor="#EAEAEA" width="80">
</td>
<td width="451" align="left" bgcolor="#EAEAEA">
<input type=radio <%if IsPub=true then response.write "checked"%> value=1 name=IsPub>
公开(大家都可见) <input
type=radio <%if IsPub=flase then response.write "checked"%> value=0 name=IsPub>
私有</td>
</tr>
<tr height =30>
<td bgcolor="#EAEAEA" width="80">
</td>
<td width="451" align="left" bgcolor="#EAEAEA">
<input name="zhai" type="submit" class="button" id="zhai" value=" 修改 "></td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="bottom.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -