如何传递参数

yijiang 2004-01-26 03:27:11
如何在第二页里得到前一页表单里的参数,并在第二页里把这个数值存进某一个特定的表中。
...全文
29 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
易寒 2004-01-27
  • 打赏
  • 举报
回复
<%
value1=request.form("formFields1")
value2=request.form("formFields2")
'打开数据库和表
set rs=server.createobject("adodb.recordset")
rs.open "数据表","数据源",1,3
'存储
%>
TrueAndFalse 2004-01-26
  • 打赏
  • 举报
回复
这样,用一个隐藏域来传递
<input type="submit" value="确定" name="B1">
<input type=hidden name=totalcash value=<%=totalcash%>

在savecash.asp中
<%
dim aa
aa=request.form("totalcash")
%>
总价=<%=aa%>
yijiang 2004-01-26
  • 打赏
  • 举报
回复
<table border="0" width="430" cellspacing="0" cellpadding="0" height="5">
<tr bgcolor="#FFCC66">
<td width="380" height="18"> 你订购的物品如下: </td>
</tr>
<tr>
<td width="100%">
<form name=myform method="POST" action="cashsave.asp">
<table border="0" width="100%" cellspacing="1">
<tr>
<td width="25%" bgcolor="#FFFFFF">商品名称</td>
<td width="25%" bgcolor="#FFFFFF">单价</td>
<td width="25%" bgcolor="#FFFFFF">数量</td>
<td width="26%" bgcolor="#FFFFFF">合计</td>
</tr>

<%
user_name=session("user_name")
sql="select * from basket where user_name='"&user_name&"' and basket_check=false"
rs.open sql,conn,3,3
if rs.eof then
response.write "你没有订购任何商品"
else
do while not rs.eof
%>
<tr>
<td width="25%"><%=rs("hw_name")%></td>
<td width="25%"><%=rs("hw_cash")%></td>
<td width="25%"><%=rs("basket_count")%></td>
<td width="26%"><%=rs("hw_cash")*rs("basket_count")%></td>
</tr><%totalcash=totalcash+(rs("hw_cash")*rs("basket_count"))%>
<%rs.movenext
loop
end if
rs.close
%>
<tr>
<td width="105%" bgcolor="#FFFFFF" colspan="4"> <p><b> </b><b>
</b> 总计:<font color=red><%=totalcash%></font>元</p>
</td>
</tr>
<tr>
<td width="105%" bgcolor="#FFFFFF" colspan="4"><input type="submit" value="确定" name="B1"></td>
</tr>
</table></form>
</td>
</tr>
<tr>
<td width="100%"></td>
</tr>


<tr>
<td width="100%">
</td>
</tr>
</table>
我想把最终的totalcash传出来
savecash.asp
<%
dim aa
aa=request.form("totalcash")
%>
总价=<%=aa%>
什么也没有,请问我应该在savecash怎么写?
TrueAndFalse 2004-01-26
  • 打赏
  • 举报
回复
@_@
yijiang 2004-01-26
  • 打赏
  • 举报
回复
谢谢,我搞定了.value="<%=aa%>"
yijiang 2004-01-26
  • 打赏
  • 举报
回复
<%
dim aa
aa=request.form("myinput")
response.write aa
%>
<input name="Input" type="text" value="aa">

我想在表单里显示AA这个值为什么不行?
TrueAndFalse 2004-01-26
  • 打赏
  • 举报
回复
1.asp
<form name=myform method=post action=2.asp>
<input type=text name=myinput value=123>
<input type=submit name=mysubmit>
</form>
2.asp
<%
dim aa
aa=request.form("myinput")
'打开数据库,并且存入
......
%>

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧