www.gusucode.com > 水族产品用品经营类企业网站asp源代码程序 > admin/admin_news_add_cl.asp

    <!--#INCLUDE VIRTUAL="/comm.asp"-->
<%
myadmin()
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")
image=request.Form("image")
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"
rs.open sql,conn,1,3
if title="" or text="" then response.Redirect("/error.asp?p=标题、正文不能为空!")
rs.addnew
rs("title")=title
rs("text")=text
rs("sort1")=sort1
if sort2<>"" then rs("sort2")=sort2
if mytime<>"" then
rs("time")=mytime
else 
rs("time")=date
end if
if from<>"" then rs("from")=from
if image<>"" then rs("image")=image
if images<>"" then rs("images")=images
if sort_txt=1 then rs("sort_txt")=true
if myindex=1 then rs("myindex")=true
rs.update

%>
<body background="../image/admin_bj.gif" onLoad="fh.focus()">
添加成功(id:<%=rs("id")%>)
<input name="fh" type="button" id="fh" value="返回" onClick="location='admin_news_add.asp'">
</body>