| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 392 人关注过本帖
标题:[求助]添加产品问题
只看楼主 加入收藏
tulipdwh
Rank: 1
等 级:新手上路
帖 子:79
专家分:0
注 册:2006-10-18
收藏
 问题点数:0 回复次数:0 
[求助]添加产品问题

我一共三个表,大,中,小三个类别。在添加的时候不能把大类和中类的id写到第三个小类这个表中,弄也挺长时间了,也弄明白。

第一页

<!--#include file="conn.asp"-->
<%
id=request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from classI where id="&id&"",conn,1,1
set rs1=server.CreateObject("adodb.recordset")
rs1.open "select * from classII where ClassI="&id&"",conn,1,1
%>

<form id="form1" name="myForm" method="post" action="admin_zmtj1.asp?id=<%=id%>">
<table width="100%" height="103" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" colspan="4" bgcolor="#006699" class="aaa"><div align="center" class="STYLE1"><%=rs("classname")%>产品添加</div></td>
</tr>
<tr>
<td colspan="4" valign="top"><table width="100%" height="458" border="0" cellpadding="0" cellspacing="0" class="aaa">
<tr>
<td height="44"> </td>
<td>产品类别:</td>
<td><label>
<select name="select">
<%do while not rs1.bof and not rs1.eof%>
<option value="<%=rs1("id")%>"><%=rs1("classname")%></option>
<%rs1.movenext
loop
rs1.close%>
</select>
</label></td>
<td> </td>
</tr>
<tr>
<td width="22%" height="44"> </td>
<td width="8%">产品名称:</td>
<td width="48%"><label>
<input name="ProductName" type="text" size="45" maxlength="100" />
</label></td>
<td width="22%"> </td>
</tr>
<tr>
<td height="219" rowspan="3"> </td>
<td height="28"> </td>
<td rowspan="3" valign="top"><table width="100%" height="336" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="27"><input name="button2" type="button" onclick="eWebEditorPopUp('s_popup', 'myForm', 'myField1')" value="HTML编辑" /></td>
</tr>
<tr>
<td height="27"><label>
<textarea name="myField1" cols="50" rows="5"></textarea>
</label></td>
</tr>
<tr>
<td height="31"><input name="button" type="button" onclick="eWebEditorPopUp('s_popup', 'myForm', 'myField')" value="HTML编辑" /></td>
</tr>
<tr>
<td><textarea name="myField" cols="50" rows="15"></textarea></td>
</tr>
</table></td>
<td rowspan="3"> </td>
</tr>
<tr>
<td height="80">产品简介:</td>
</tr>
<tr>
<td height="216">产品内容:</td>
</tr>
<tr>
<td height="37"> </td>
<td>产品图片:</td>
<td><label>
<input name="photo" type="text" size="30" maxlength="50" />
<input type="button" name="Button" value="上 传" onClick="javascript:document.form1.photo.value=window.showModalDialog('admin_img.html','','dialogHeight:130px;dialogWidth:410px;help:no;status:no;scroll:no')">
</label></td>
<td></td>
</tr>
<tr>
<td colspan="4"><label>
<div align="center">
<input type="button" name="button" value="提 交" onclick="check()" />

<input type="reset" name="Submit2" value="重 置" />

第二页

<!--#include file="conn.asp"-->
<%
dim ProductName,ProductInfo,productInfo1,tupian
ProductName=trim(request.Form("ProductName"))
ProductInfo=trim(request.Form("myField1"))
productInfo1=trim(request.Form("myField"))

set rs=server.CreateObject("adodb.recordset")
rs.open "select * from Product where classI="&request("id")&"",conn,1,3

rs.addnew
rs("ProductName")=trim(request.Form("ProductName"))
rs("ProductInfo")=trim(request.Form("myField1"))
rs("ProductInfo1")=trim(request.Form("myField"))

rs.update
rs.close
response.write "<script>"
response.write "alert('产品添加成功!');window.location='admin_jy.asp'"
response.write "</script>"
set rs=nothing
conn.close
set conn=nothing
%>

2006-12-23 14:13
快速回复:[求助]添加产品问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030019 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved