回复 16楼 川之鱼,这是PostData.asp的代码
程序代码:
'产品信息管理///////////////////////////////////////////////////////////
sub Products()
dim Actions
Actions=SafeInput(Request("Actions"))
Select case Actions
case "Delete"
call DeleteProducts()
case "Update"
call UpdateProducts()
case "Add"
call AddProducts()
end select
end sub
sub AddProducts()
dim sql,ProName,ProAddress,ProDate,NewsFile,ProType,NewsTitle2,cpgg
ProType=SafeInput(unescape(Request.Form("ProName.value")))
ProName=SafeInput(unescape(Request.Form("ProName")))
NewsFile=unescape(Request.Form("NewsFile"))
NewsTitle2=SafeInput(unescape(Request.Form("NewsTitle2")))
cpgg=SafeInput(unescape(Request.Form("cpgg")))
'NewsFile="a"
'ProDate=time()
sql="insert into jujia_Product (ProName,ProAddress,ProType,NewsTitle2,cpgg) values "
sql=sql&"('"&ProType&"','"&NewsFile&"','"&ProType&"','"&NewsTitle2&"','"&cpgg&"')"
conn.execute(sql)
Response.Write(escape("添加成功!"))
end sub
sub UpdateProducts()
dim sql,ProName,ProType,NewsTitle2,cpgg,ID
NewsTitle2=SafeInput(unescape(Request.Form("NewsTitle2")))
ProType=SafeInput(unescape(Request.Form("ProType")))
cpgg=SafeInput(unescape(Request.Form("cpgg")))
ID=SafeInput(Request.Form("ID"))
If IsNumeric(ID) and not IsEmpty(ID) then
sql="update jujia_Product Set NewsTitle2='"&NewsTitle2&"',cpgg='"&cpgg&"'"
sql=sql&" where ID="&ID
on error resume next
conn.execute(sql)
'Response.write(sql)'停止执行后面代码
'Response.end()'停止执行后面代码
Response.Write(escape("修改成功!"))
else
Response.Write(escape("你提交的数据中含有非法字符!"))
end if
end sub
sub DeleteProducts()
dim sql,ID
ID=SafeInput(Request.Form("ID"))
If IsNumeric(ID) and not IsEmpty(ID) then
sql="delete from jujia_Product where ID="&ID
conn.execute(sql)
Response.Write(escape("删除成功!"))
else
Response.Write(escape("你提交的数据中含有非法字符!"))
end if
end sub