⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editgoods.asp

📁 描述了网上。购物的流程和功能
💻 ASP
字号:
<%
if session("admin_name")="" then response.end
set rs=server.createobject("adodb.recordset")
%>
<!--#include file="conn.asp"--><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
<style type="text/css">
<!--
body {
	background-color: #FFFFFF;
}
-->
</style></head>
<%
if request("action")="save" then
    hw_name=request("hw_name")
    leibie=request("leibie")
    hw_cash=request("hw_cash")
    hw_pic=request("hw_pic")
ISBN=request("ISBN")
xing=request("xing")
ping=request("ping")
lei=request("lei")
zuoze=request("zuoze")
hwsn=request("hwsn")
hw_oldcash=request("hw_oldcash")
tejia=request("tejia")
hw_content=request.form("hw_content")
    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 hw_cash="" then
        errmsg=errmsg+"<br>"+"<li>商品价格不能为空"
        founderr=true
    end if
   
    if hw_pic="" then hw_pic="img/no.jpg"
    
    if founderr=true then
        response.write errmsg
        response.write "<br>"
        response.write "<a href=addhw.asp>返回</a>"
        response.end
    else
       

        hw_pic=server.htmlencode(hw_pic)    
        
        sql="select * from hw where hw_id="&request("hw_id")
        rs.open sql,conn,3,3
        rs("hw_name")=hw_name
        rs("xing")=xing
        rs("ping")=ping
        rs("lei")=lei
        rs("leibie")=leibie
       if tejia="on" then   
       rs("tejia")=true
      else 
      rs("tejia")=false
      end if
        rs("hw_content")=hw_content
        rs("hw_cash")=hw_cash
rs("zuoze")=zuoze
rs("hw_oldcash")=hw_oldcash
       rs("hw_sn")=hwsn
       rs("ISBN")=ISBN
        rs("hw_pic")=hw_pic
        rs.update
    end if
    response.write "货物修改成功"
    response.write "<p>"%>
    <%response.write "<br>"
    response.write "<a href=delhw.asp>返回</a>"
    rs.close
    

else
%>
          <%   sql="select * from hw where hw_id="&request("hw_id")
    rs.open sql,conn,3,3
   tejia=rs("tejia")
hw_content=rs("hw_content")
%> 
<table border="0" width="100%" cellspacing="1">
  <tr>
    <td width="100%">
      <form method="POST" action="editgoods.asp?action=save"  name="myform">

          <table width="98%" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
    <tr> 
      <td  bgcolor="#4296E7" colspan=2> 
        <div align="center"><font color="#FFFFFF">添加商品[如果不添则浏览时不显示]</font></div>      </td>
    </tr>
    <input type="hidden" name="hw_id" size="20" class=input value="<%=rs("hw_id")%>">
          <tr> 
            <td width="12%">商品名</td><td width=88%>  
<input type="text" name="hw_name" size="20" class=input maxlength=20 value="<%=rs("hw_name")%>"><font color=red>*必须(最长20个字)</font>
            </td>
          </tr>
          <tr> 
            <td width="12%"> 商品原价</td><td width=88%>  
              <input type="text" name="hw_oldcash" size="20" class=input maxlength=10 value="<%=rs("hw_oldcash")%>">              
              <font color=red>*</font></td>
          </tr>

          <tr> 
            <td width="12%"> 商品现价</td><td width=88%>  
              <input type="text" name="hw_cash" size="20" class=input  maxlength=10 value="<%=rs("hw_cash")%>">              
              <font color=red>*</font></td>
          </tr>
          <tr> 
            <td width="12%">是否特价</td><td width=88%>  
              <input type="checkbox" name="tejia"> 特价商品
            </td>
          </tr>

          <tr> 
            <td colspan=2>商品介绍</td>
          </tr>
          <tr> 
            <td colspan=2> 
            <textarea rows="9" name="hw_content" cols="77" class=input><%=rs("hw_oldcash")%></textarea><font color=red>*必须</font>            </td>
          </tr>
          <tr> 
            <td colspan=2>商品图片 <input type="text" name="hw_pic" size="75" class=input  maxlength=100  value="<%=rs("hw_pic")%>"></td>
          </tr>
        </table>
        <p><input type="submit" value="提交" name="B1" class=input><input type="reset" value="全部重写" name="B2" class=input></p>
      </form>
        </td>
  </tr>
</table>

<%rs.close
end if
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -