'判断传过来的参数符不符合要求 if request.form("title")="" then response.redirect "delete.asp" end if if request.form("comment")="" then response.redirect "delete.asp" end if if request.form("class_name")="" then response.redirect "delete.asp" end if select case request.form("class_name") case "市场风云" class=1 case "IT新闻" class=2 case "广州市场" class=3 case "保 留" class=4 case "保 留" class=4 end select '连接数据库 %》 《!--#include Virtual="/news/data/data.inc"--》 《%
Set rs = Server.CreateObject("ADODB.Recordset") sql="select * from data order by news_id ASC" rs.open sql,conn,3,2
'查找编号 if rs.bof then reco=0 else rs.movelast reco=Clng(rs("news_id"))+1 end if
rs.addnew rs("news_id")=reco
if request.form("head")="YES" then rs("news_head")=-1 end if
rs("news_class")=class rs("news_class_name")=request.form("class_name") if request.form("pic")《》"" then rs("news_pic")=request.form("pic") rs("news_title")=request.form("title")&"(图文)" else rs("news_title")=request.form("title") end if
if request.form("head")="YES" then rs("news_head")=-1 end if
tmpmess=request.form("comment") tmpmess=replace(tmpmess,chr(10)," ") tmpmess=replace(tmpmess,"《","《") tmpmess=replace(tmpmess,"》","》") tmpmess=replace(tmpmess," "," ") rs("news_comment")=tmpmess rs("news_year")=year(Date) rs("news_month")=month(Date) rs("news_day")=day(Date) if Instr(Time,"下午")》0 then tmp=left(right(Time,8),2)+12 rs("news_time")=tmp&right(Time,6) else rs("news_time")=tmp&right(Time,8) end if