www.gusucode.com > 水族产品用品经营类企业网站asp源代码程序 > admin/admin_news_edit_cl.asp
<!--#INCLUDE VIRTUAL="/comm.asp"--> <% myadmin() id=request.Form("id") if mycheckchar(id,"0123456789")="#nosafe#" then response.Redirect("/error.asp?p=id非纯数字") title=request.Form("title") sort1=request.Form("sort1") sort2=request.Form("sort2") text=request.Form("text") if request.Form("time")<>"" then mytime=DateValue(request.Form("time")) from=request.Form("from") caller=request.Form("caller") if caller="" then caller=0 image=request.Form("image") if image<>"" then else image=null end if images=request.Form("images") sort_txt=request.Form("sort_txt") myindex=request.Form("myindex") Set conn = Server.CreateObject("ADODB.Connection") conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/db/db.mdb") Set rs = Server.CreateObject("ADODB.Recordset") sql="select * from content where id=" & id rs.open sql,conn,3,2 if rs.eof then response.Redirect("/error.asp?p=id不存在") if title="" or text="" then response.Redirect("/error.asp?p=标题、正文不能为空!") rs("title")=title rs("text")=text rs("sort1")=sort1 rs("caller")=caller if sort2<>"" then rs("sort2")=sort2 else rs("sort2")=0 end if if mytime<>"" then rs("time")=mytime else rs("time")=date end if rs("from")=from rs("image")=image rs("images")=images if sort_txt=1 then rs("sort_txt")=true else rs("sort_txt")=false if myindex=1 then rs("myindex")=true else rs("myindex")=false rs.update %> <body onLoad="fh.focus()" background="../image/admin_bj.gif"> 修改成功 <input name="fh" type="button" id="fh" value="返回" onClick="location='admin_text_list.asp'"> </body>