最近问题特多。。。
我在user_shop.asp中定义了一些按钮
其中一个 "去收银台结账" 当我按下了以后 我要求进入到user_order.asp 需要带一些参数进入
实现的代码是这样
If Not Isempty(Request("money")) Then '去收银台
idstr=Request.Form("id")
Response.Write("<script language='javascript'>window.open('User_order.asp?
idstr="+idstr+"','收银台','height=590,width=530');</script>")
End If
在user_order.asp中
idstr=Request.QueryString("idstr") 接受user_shop.asp中传过来的idstr
大家帮我看看哪里有问题
帮我解释一下这句什么意思···解释的具体点~~'User_order.asp?idstr="+idstr+"'
所有的代码在下面···
user_shop.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="checkUserLogin.asp"-->
<!--#include file="include/conn.asp"-->
<!--#include file="include/function.asp"-->
<%
id=Request("id")
shopping = Session("shopping")
ShopBag id,shopping
'执子过程ShopBag(id,shopping)
Session("shopping") = shopping
'将获得的商品ID存储在Session变量中
Sub ShopBag(id,shopping)
'定义子过程,将选择的商品ID存储于变量shopping中
If Len(shopping) = 0 Then
shopping =id
ElseIf InStr( shopping, id ) <= 0 Then
shopping = shopping&", "&id&""
End If
End Sub
If Not Isempty(Request("money")) Then '去收银台
idstr=Request.Form("id")
Response.Write("<script language='javascript'>window.open('User_order.asp?
idstr="+idstr+"','收银台','height=590,width=530');</script>")
End If
If Not Isempty(Request("clear")) Then '清空购物车
Session("shopping")=""
Response.Write("<script>alert('您的购物车已清
空!');window.location.href='User_shop.asp';</script>")
End if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>BTC电子商城----购物车</title>
<link rel="stylesheet" href="css/css.css">
</head>
<body background="images/bg.gif">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0"
bgcolor="#FFFFFF">
<tr>
<td colspan="2"><!--#include file="top.asp"--></td>
</tr>
<tr valign="top">
<td width="200"><!--#include file="left.asp"--></td>
<td><!--#include file="web_search.asp"-->
<!--#include file="web_goods_class.asp"-->
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1"
bgcolor="#f0f0f0">
<tr align="center">
<td height="22"><a href="User_center.asp?action=file_edit">会员资料修改</a></td>
<td height="22"><a href="User_center.asp?action=pwd_edit">会员密码修改</a></td>
<td height="22"><a href="User_shop.asp">购物车</a></td>
<td height="22"><a href="User_center.asp?action=order">订单查询</a></td>
<td height="22"><a href="User_center.asp?action=consume">消费查询</a></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="22" colspan="6"><table width="500" border="0" align="center"
cellpadding="0" cellspacing="1" bgcolor="#f0f0f0">
<form name="form1" method="post" action="">
<tr align="center" bgcolor="#FFFFFF" style="color:#FF0000 ">
<td height="5" colspan="6"></td>
</tr>
<tr align="center" bgcolor="#FFFFFF" style="color:#FF0000 ">
<td height="22">选择</td>
<td height="22">商品名称</td>
<td height="22">数量</td>
<td height="22">会员价</td>
<td height="22">折扣率</td>
<td height="22">小计</td>
</tr>
<script language="javascript">
<!--
function check(form1,text)
{
if(isNaN(text.value) || text.value.indexOf('.',0)!=-1){
alert("请不要输入非法字符");text.focus();return;}
if(text.value=="")
{
alert("请输入修改的数量");text.focus();return;}
form1.submit();
}
-->
</script>
<%If Session("shopping")="" Then%>
<tr align="center" bgcolor="#FFFFFF">
<td height="22" colspan="6">您还没有选择商品!</td>
</tr>
<%Else%>
<%
Set rsc=conn.Execute("select Adiscount from tab_user_account where Uname='"&Session
("Uname")&"'")
Session("User_discount")=rsc("Adiscount")
'获得此用户在网站购买商品的折扣率
Set rsc=Nothing
Set rs=Server.CreateObject("ADODB.Recordset")
sqlstr="select id,Gname,Ggprice from tab_goods where id in ("&Session("shopping")&")"
rs.open sqlstr,conn,1,3
while not rs.eof
if Request.Form("Goods"&rs("id"))<>"" then
Num=Request.Form("Goods"&rs("id"))
Session(rs("id"))=Num
If (Num="" or Num<=0) Then Num=1
else
If Session(rs("id"))<>"" Then
Num=Session(rs("id"))
else
Num=1
end if
end if
%>
<tr align="center" bgcolor="#FFFFFF">
<td height="22"><input name="id" type="checkbox" id="id" value="<%=rs("id")%>"
checked></td>
<td height="22"><a href="web_goods_view.asp?id=<%=rs("id")%>"><%=rs("Gname")%
></a></td>
<td height="22"><input name="Goods<%=rs("id")%>" type="text" size="3" value="<%
=Num%>" onBlur="check(this.form,this)"></td>
<td height="22">¥<%=rs("Ggprice")%></td>
<td height="22"><%=Session("User_discount")%></td>
<td height="22">¥<%=abs(rs("Ggprice")*Num*Session("User_discount"))%></td>
</tr>
<%
sum=sum+rs("Ggprice")*Num*Session("User_discount") '计算选中商品的总金额
rs.movenext
wend
rs.close
Set rs=Nothing
%>
<tr align="center" bgcolor="#FFFFFF">
<td height="22" colspan="6"><a href="index.asp">继续购物</a>
<input name="edit" type="submit" id="edit" value="修改数量">
<input name="money" type="submit" id="money" value="去收银台结账">
<input name="clear" type="submit" id="clear" value="清空购物车">
总计:¥<%=abs(sum)%> </td>
</tr>
</form>
<%End If%>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><!--#include file="bottom.asp"--></td>
</tr>
</table>
</body>
</html>