savehw.jsp
上传用户:szlmxq
上传日期:2014-01-31
资源大小:740k
文件大小:3k
源码类别:

Applet

开发平台:

Java

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