savehw.jsp
上传用户:helenhuo66
上传日期:2007-06-01
资源大小:865k
文件大小:3k
源码类别:

百货/超市行业

开发平台:

Java

  1. <%
  2. if session("admin_name")="" then response.end
  3. dim count
  4. set rs=server.createobject("adodb.recordset")
  5. %>
  6. <!--#include file="conn.asp"--><head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  8. <link href=../css.css rel=STYLESHEET type=text/css>
  9. </head>
  10. <%
  11. if request("action")="save" then
  12.     hw_name=request("hw_name")
  13.     hw_content=request("hw_content")
  14.     hw_cash=request("hw_cash")
  15.     hw_pic=request("hw_pic")
  16. chubsh=request("chubsh")
  17. zhuang=request("zhuang")
  18. yeshu=request("yeshu")
  19. isbn=request("isbn")
  20.     sort_id=request("sort_id")
  21.     Nsort_id=request("Nsort_id")
  22.     company=request("company")
  23.    pifa=request("pifa")
  24. daili=request("daili")
  25. hwsn=request("hwsn")
  26. data=request("data")
  27. kaiben=request("kaiben")
  28.     if not(isnumeric(hw_cash)) then
  29.         errmsg="<br>"+"<li>价格应该为数字"
  30.         founderr=true
  31.     end if
  32.     if hw_name="" then
  33.         errmsg=errmsg+"<br>"+"<li>名称不能为空"
  34.         founderr=true
  35.     end if
  36.     if hw_content="" then
  37.         errmsg=errmsg+"<Br>"+"<li>介绍不能为空"
  38.         founderr=true
  39.     end if
  40.     if sort_id="" then
  41.         errmsg=errmsg+"<br>"+"<li>类别不能为空"
  42.         founderr=true
  43.     end if
  44.    if nsort_id="" then
  45.         errmsg=errmsg+"<br>"+"<li>类别不能为空"
  46.         founderr=true
  47.     end if
  48.     if nsort_id="" then
  49.      errmsg=errmsg+"<br>"+"<li>类别不能为空"
  50.         founderr=true
  51.     end if
  52.     if hw_pic="" then hw_pic="img/noimage.gif"
  53.     
  54.     if founderr=true then
  55.         response.write errmsg
  56.         response.write "<br>"
  57.         response.write "<a href=addhw.asp>返回</a>"
  58.         response.end
  59.     else
  60.         hw_name=server.htmlencode(hw_name)
  61.         hw_name=replace(hw_name," ","&nbsp;")
  62.         hw_name=replace(hw_name,chr(13)&chr(10),"<Br>")
  63.         
  64.         
  65.         hw_content=server.htmlencode(hw_content)
  66.         hw_content=replace(hw_content," ","&nbsp;")
  67.         hw_content=replace(hw_content,chr(13)&chr(10),"<Br>")        
  68.         
  69.         hw_pic=server.htmlencode(hw_pic)    
  70.         
  71.         sql="select * from hw"
  72.         rs.open sql,conn,3,3
  73.         rs.addnew
  74.         rs("hw_name")=hw_name
  75.         rs("hw_content")=hw_content
  76.         rs("hw_cash")=hw_cash
  77.         rs("sort_id")=sort_id
  78. rs("Nsort_id")=Nsort_id
  79.        rs("company")=company
  80.        rs("daili")=daili
  81.        rs("pifa")=pifa
  82.        rs("hw_sn")=hwsn
  83.    rs("chubsh")=chubsh
  84.    rs("kaiben")=kaiben
  85.    rs("yeshu")=yeshu
  86.    rs("data")=data
  87.    rs("isbn")=isbn
  88.    rs("zhuang")=zhuang
  89.         rs("hw_pic")=hw_pic
  90.         rs.update
  91.     end if
  92.     response.write "货物添加成功"
  93.     response.write "<br>"
  94.     response.write "<a href=addhw.asp>返回</a>"
  95.     rs.close