
| 以下为引用的内容: <!--#include file="conn.asp" --> <!--#include file="lib.asp" --> <%id=request.querystring("c_id")%> <% if request.form("submit")="change" then c_title=request.form("c_title") c_content=request.form("c_content") c_id=request.form("c_id") c_filepath=request.form("c_filepath") Set rs = Server.CreateObject ("ADODB.Recordset") sql = "Select * from c_news where c_id="&c_id rs.Open sql,conn,3,2 rs("c_title")=c_title rs("c_content")=c_content rs("c_time")=now() rs.update rs.close Set rs = Nothing %> <%'打开模板代码,并将其中特殊代码转变为接受值 sql1="select m_id,m_html from c_moban where m_id=1" set rs1=Server.CreateObject("adodb.recordset") rs1.open sql1,conn,1,1 mb_code=rs1("m_html") rs1.close set rs1=nothing conn.close set conn=nothing c_title=htmlencode(c_title) c_content=htmlencode(c_content) mb_code=replace(mb_code," $cntop{LogContent}quot;,now()) mb_code=replace(mb_code," $cnleft{LogContent}quot;,c_title) mb_code=replace(mb_code," $cnright{LogContent}quot;,c_content) %> <%'生成HTML页面 Set fso = Server.CreateObject("Scripting.FileSystemObject") Set fout = fso.CreateTextFile(Server.MapPath(c_filepath)) fout.WriteLine mb_code fout.close %> <%response.redirect("showit.asp")%> <%end if%> <% if id<>"" then Set rs = Server.CreateObject ("ADODB.Recordset") sql="select * from c_news where c_id="&id rs.Open sql,conn,1,1 c_id=rs("c_id") c_filepath=rs("c_filepath") c_title=rs("c_title") c_content=rs("c_content") end if %> <form action="change.asp" method="post"> Title:<input type="text" name="c_title" value=<%=c_title%>><br> Content:<br> <textarea name="c_content" rows="8" cols="30"><%=c_content%></textarea><br> <input type="submit" value="change" name="submit"> <input type="reset" value="Reset"> <input name="c_id" type="hidden" value="<%=id%>"> <input name="c_filepath" type="hidden" value="<%=c_filepath%>"> </form> |
| 以下为引用的内容: <!--#include file="conn.asp" --> <% c_id = request.querystring("c_id") sql = "Select * from c_news where c_id="&c_id Set rs = Server.CreateObject ("ADODB.Recordset") rs.Open sql,conn,2,3 filepath=rs("c_filepath") Set fso = CreateObject("Scripting.FileSystemObject") fso.DeleteFile(Server.mappath(filepath)) Set fso = nothing rs.delete rs.close Set rs = Nothing conn.close set conn=nothing %> <%response.redirect("showit.asp")%> |