<!--#include file="check.asp"-->
<!--#include file="db/conn.asp"-->
<!--#include file="char.asp"-->
<%
dim rs,sql
dim z_title2
dim z_information
dim founderr
dim z_id
dim z_fabao
dim z_pihao
founderr=false
if trim(request.form("z_title2"))="" then
founderr=true
errmsg="<li>文章名不能为空</li>"
end if
if trim(request.form("z_information"))="" then
founderr=true
errmsg=errmsg+"<li>文章内容不能为空</li>"
end if
if founderr=false then
z_title2=htmlencode(request.form("z_title2"))
z_pihao=request.form("z_pihao")
z_fa=request.Form("z_fa")
z_bao=request.Form("z_bao")
z_dengji=request.Form("z_dengji")
if request("htmlable")="yes" then
z_information=htmlencode(request.form("z_information"))
else
z_information=ubbcode(request.form("z_information"))
end if
set rs=server.createobject("adodb.recordset")
if request("action")="add" then
call newsoft()
elseif request("action")="edit" then
call editsoft()
else
founderr=true
errmsg=errmsg+"<li>没有选定参数</li>"
end if
sub newsoft()
sql="select * from zhiban"
rs.open sql,conn,1,3
rs.addnew
rs("z_title2")=z_title2
rs("z_information")=z_information
rs("z_fa")=z_fa
rs("z_bao")=z_bao
rs("z_pihao")=z_pihao
rs("z_dengji")=z_dengji
rs("z_date")=now()
rs.update
z_id=rs("z_id")
end sub
sub editsoft()
sql="select * from zhiban where z__id="&request("z_id")
rs.open sql,conn,1,3
rs("z_title2")=z_title2
rs("z_information")=z_information
rs("z_pihao")=z_pihao
rs("z_fa")=z_fa
rs("z_bao")=z_bao
rs("z_dengji")=z_dengji
rs.update
z_id=rs("z_id")
end sub
end if
response.redirect "nmanage1.asp"
%>