最近问题特多。。。

woods2001 2009-05-04 01:33:23
我在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>



...全文
112 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangjun 2011-12-15
  • 打赏
  • 举报
回复
我现在也碰到了这个点击按钮跳转到另外一个页面的问题了!急求解啊!
xiaojielanbaihe 2009-05-04
  • 打赏
  • 举报
回复
idstr="+idstr+" 这就是传参
等号左边是要传给User_order.asp页面变量,右边是赋的值
woods2001 2009-05-04
  • 打赏
  • 举报
回复
idstr="+idstr+"
这个什么意思
lzj34 2009-05-04
  • 打赏
  • 举报
回复
代码太长了,这是在考我们呀!!没有说具体错误不好回答!!
window.open('User_order.asp?
idstr="+idstr+"','收银台','height=590,width=530')// 就是打开一个窗口URL为User_order.asp?idstr="+idstr+"
joking520 2009-05-04
  • 打赏
  • 举报
回复
比面试的考试题还难,不说问题点,直接让让找错误

'User_order.asp?idstr="+idstr+"'

If Not Isempty(Request("money")) Then '去收银台
idstr=Request.Form("id") '获取表单id的值,并赋值给变量 idstr
Response.Write(" <script language='javascript'>window.open('User_order.asp?
idstr="+idstr+"','收银台','height=590,width=530'); </script>") '在客户端输出javascript代码,并且将变量 idstr 的值带进来,作为 User.order.asp?idstr=...的参数值。
End If

woods2001 2009-05-04
  • 打赏
  • 举报
回复
专家过来看看 ~`~
woods2001 2009-05-04
  • 打赏
  • 举报
回复
专家过来看看 ~`~
woods2001 2009-05-04
  • 打赏
  • 举报
回复
user_order.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="checkUserLogin.asp"-->
<!--#include file="include/conn.asp"-->
<!--#include file="include/function.asp"-->
<%
Sub add()
str1="OD"&GetOrderNo(Now())
str2=Str_filter(Request.Form("收货人姓名"))
str3=Str_filter(Request.Form("详细地址"))
str4=Str_filter(Request.Form("邮编"))
str5=Str_filter(Request.Form("电话"))
str6=Str_filter(Request.Form("电子邮件"))
str7=Str_filter(Request.Form("送货方式"))
str8=Str_filter(Request.Form("支付方式"))
str9=Str_filter(Request.Form("留言"))
If str2<>"" and str3<>"" and str4<>"" and str5<>"" and str6<>"" and str7<>"" and str8<>"" Then
Set rs=Server.CreateObject("ADODB.Recordset")
sqlstr="select * from tab_order"
rs.open sqlstr,conn,1,3
rs.addnew
rs("Ofid")=str1
rs("Oname")=str2
rs("Oaddress")=str3
rs("Opcode")=str4
rs("Otel")=str5
rs("Oemail")=str6
rs("Otransport")=str7
rs("Opay")=str8
rs("Ointro")=str9
rs("Uname")=Session("Uname")
rs("Gname")=Session("Goods_name")
rs("Gnum")=Session("Numstr")
rs("Ggprice")=Session("Goods_price")
rs("Udiscount")=Session("User_discount")
rs("Omoney")=Session("sum")
rs("Ostate")="新订单"
rs.update
rs.close
Set rs=Nothing
call clearshop()
End If
End Sub
Sub clearshop()
Session("shopping")=""
Response.Write("<script>alert('您的订单已成功提交!');window.close();opener.location.href='User_center.asp';</script>")
End Sub
If Not Isempty(Request("order")) Then call add()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>BTC电子商城----订单</title>
<link rel="stylesheet" href="css/css.css">
<script language="javascript">
function Mycheck(form){
for(i=0;i<form.length;i++){
if(form.elements[i].value==""){
alert(form.elements[i].name + "不能为空!");return false;}
else{
if(!checkEmail(form.elements[4].value)){
alert('E-mail地址输入不正确!');return false;}
}
}
}
</script>
<style type="text/css">
<!--
body {
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body>
<table width="529" height="100" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="529" height="8"></td>
</tr>
<tr>
<td valign="top"><table width="507" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="51" align="left" valign="middle" background="images/dd.jpg"> </td>
</tr>
<tr>
<td><table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#f0f0f0">
<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>
</tr>
<%
idstr=Request.QueryString("idstr")
'获得用户选择的所有商品ID编号
Set rs=Server.CreateObject("ADODB.Recordset")
sqlstr="select id,Gname,Ggprice from tab_goods where id in ("&idstr&")"
rs.open sqlstr,conn,1,3
'while not rs.eof
'Num=Session(rs("id"))
'获得用户选定商品的数量
'Session(rs("id"))=""

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
Session(rs("id"))=""

%>
<tr align="center" bgcolor="#FFFFFF">
<td height="22"><%=rs("Gname")%></td>
<td height="22"><%=Num%></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")
If Goods_name="" Then Goods_name=rs("Gname") Else Goods_name=Goods_name&","&rs("Gname")
If Goods_price="" Then Goods_price=rs("Ggprice") Else Goods_price=Goods_price&","&rs("Ggprice")
If Numstr="" Then Numstr=Num Else Numstr=Numstr&","&Num
rs.movenext
wend
Session("Goods_name")=Goods_name
Session("Goods_price")=Goods_price
Session("Numstr")=Numstr
Session("sum")=sum

rs.close
Set rs=Nothing
%>
<tr align="center" bgcolor="#FFFFFF">
<td height="22" colspan="5"> 总计:<%=sum%></td>
</tr>
</table>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="BDBDBC">
<form name="form1" method="post" action="">
<%
Set rs=conn.Execute("select Uname,Urname,Uaddress,Upcode,Utel,Uemail from tab_user_reg where Uname='"&Session("Uname")&"'")
%>
<tr bgcolor=#ffffff>
<td width="99">收货人姓名:</td>
<td width="398" height="28">
<input name="收货人姓名" type="text" id="收货人姓名2" value=<%=rs("Urname")%> size="12">
</td>
</tr>
<tr bgcolor=#ffffff>
<td>详细地址:</td>
<td height="28"><input name="详细地址" type="text" id="详细地址2" value=<%=rs("Uaddress")%> size="40"></td>
</tr>
<tr bgcolor=#ffffff>
<td>邮  编:</td>
<td height="28"><input name="邮编" type="text" id="邮编2" value=<%=rs("Upcode")%> size="10"></td>
</tr>
<tr bgcolor=#ffffff>
<td>电  话:</td>
<td height="28"><input name="电话" type="text" id="电话2" value=<%=rs("Utel")%> size="12"></td>
</tr>
<tr bgcolor=#ffffff>
<td>电子邮件:</td>
<td height="28"><input name="电子邮件" type="text" id="电子邮件2" value=<%=rs("Uemail")%>></td>
</tr>
<tr bgcolor=#ffffff>
<td>送货方式:</td>
<td height="28">
<select name=送货方式 size=3 id=select>
<option value=普通平邮>普通平邮</option>
<option value=特快专递>特快专递(EMS)</option>
<option value=送货上门 selected>送货上门</option>
</select></td>
</tr>
<tr bgcolor=#ffffff>
<td>支付方式:</td>
<td height="20">
<select name=支付方式 size=4 id=select2>
<option value=工商银行汇款>工商银行汇款</option>
<option value=建设银行汇款 selected>建设银行汇款</option>
<option value=邮局汇款>邮局汇款</option>
<option value=交通银行汇款>交通银行汇款</option>
</select>
</td>
</tr>
<tr bgcolor=#ffffff>
<td>留 言:</td>
<td><textarea name="留言" cols="40" rows="3" id="textarea"></textarea></td>
</tr>
<tr bgcolor=#ffffff>
<td></td>
<td height="28" bgcolor="#ffffff"><input name="order" type="submit" id="order2" value="提交订单" onClick="return Mycheck(this.form)">
<input type="button" name="Submit" value="返 回" onClick="javascript:window.close();"></td>
</tr>
<%Set rs=Nothing%>
</form>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

28,390

社区成员

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

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