savehw.jsp
上传用户:szlmxq
上传日期:2014-01-31
资源大小:740k
文件大小:3k
- <%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
- <%
- if session("admin_name")="" then response.end
- dim count
- set rs=server.createobject("adodb.recordset")
- %>
- <!--#include file="conn.asp"--><head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <link href=../css.css rel=STYLESHEET type=text/css>
- </head>
- <%
- if request("action")="save" then
- hw_name=request("hw_name")
- hw_content=request("hw_content")
- hw_cash=request("hw_cash")
- hw_pic=request("hw_pic")
- chubsh=request("chubsh")
- zhuang=request("zhuang")
- yeshu=request("yeshu")
- isbn=request("isbn")
- sort_id=request("sort_id")
- Nsort_id=request("Nsort_id")
- company=request("company")
- pifa=request("pifa")
- daili=request("daili")
- hwsn=request("hwsn")
- data=request("data")
- kaiben=request("kaiben")
- if not(isnumeric(hw_cash)) then
- errmsg="<br>"+"<li>价格应该为数字"
- founderr=true
- end if
- if hw_name="" then
- errmsg=errmsg+"<br>"+"<li>名称不能为空"
- founderr=true
- end if
- if hw_content="" then
- errmsg=errmsg+"<Br>"+"<li>介绍不能为空"
- founderr=true
- end if
- if sort_id="" then
- errmsg=errmsg+"<br>"+"<li>类别不能为空"
- founderr=true
- end if
- if nsort_id="" then
- errmsg=errmsg+"<br>"+"<li>类别不能为空"
- founderr=true
- end if
- if nsort_id="" then
- errmsg=errmsg+"<br>"+"<li>类别不能为空"
- founderr=true
- end if
- if hw_pic="" then hw_pic="img/noimage.gif"
-
- if founderr=true then
- response.write errmsg
- response.write "<br>"
- response.write "<a href=addhw.asp>返回</a>"
- response.end
- else
- hw_name=server.htmlencode(hw_name)
- hw_name=replace(hw_name," "," ")
- hw_name=replace(hw_name,chr(13)&chr(10),"<Br>")
-
-
- hw_content=server.htmlencode(hw_content)
- hw_content=replace(hw_content," "," ")
- hw_content=replace(hw_content,chr(13)&chr(10),"<Br>")
-
- hw_pic=server.htmlencode(hw_pic)
-
- sql="select * from hw"
- rs.open sql,conn,3,3
- rs.addnew
- rs("hw_name")=hw_name
- rs("hw_content")=hw_content
- rs("hw_cash")=hw_cash
- rs("sort_id")=sort_id
- rs("Nsort_id")=Nsort_id
- rs("company")=company
- rs("daili")=daili
- rs("pifa")=pifa
- rs("hw_sn")=hwsn
- rs("chubsh")=chubsh
- rs("kaiben")=kaiben
- rs("yeshu")=yeshu
- rs("data")=data
- rs("isbn")=isbn
- rs("zhuang")=zhuang
- rs("hw_pic")=hw_pic
- rs.update
- end if
- response.write "货物添加成功"
- response.write "<br>"
- response.write "<a href=addhw.asp>返回</a>"
- rs.close