if Request.QueryString("cz")="" then
Response.Redirect"info.asp?info=错误的参数"
else
cz=Request.QueryString("cz")
end if
if cz="del" then
conn.execute "delete from pic where id="&Request.QueryString("id")
Response.Redirect"add_pic.asp"
else
REM ------判断数据有效性------
founderr=false
if trim(Request.Form("name"))="" then
founderr=true
info=info+"请填写图片的名称"
end if
REM ------如果数据是有效的则开始存储数据并显示相关信息------
if founderr=false then
set rs=server.createobject("adodb.recordset")
if cz="addfile" then
sql="select * from pic where (id is null)"
rs.open sql,conn,1,3
rs.addnew
else
sql="select * from pic where id="&Request.QueryString("id")
rs.open sql,conn,1,3
end if
rs("name")=Request.Form("name")
if Request.Form("smallimg")="" then
rs("smallimg")="images/nominipic.gif"
else
rs("smallimg")=Request.Form("smallimg")
end if
rs.update
rs.close
set rs=nothing
conn.close
Set conn=Nothing
if cz="addfile" then
Response.Redirect"add_pic.asp"
else
Response.Redirect"add_pic.asp"
end if
REM ------如果数据是无效的则开始显示错误信息------
else
call infom()
end if
end if
function HTMLEncode2(fString)
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "")
fString = Replace(fString, CHR(10), "")
HTMLEncode2 = fString
end function
%>