当前位置: 首页 > 图文教程 > 网络编程 > ASP > 购物车范例(购物车页面 )

ASP
ASP简单入门教程(2):ASP环境配置
ASP简单入门教程(3):ASP语法
ASP简单入门教程(4):ASP变量
ASP简单入门教程(5):ASP子程序
HTTP 500 - 内部服务器错误(补充内容)
ASP教程:IIS中配置多站点
ASP实例教程:Content Rotator (ASP 3.0)
ASP实例教程:Content Linking组件
ASP实例教程:Browser Capabilities组件
ASP实例教程:AdRotator组件
ASP实例教程:Dictionary对象
ASP实例教程:File对象
ASP实例教程:Drive对象
ASP实例教程:TextStream对象
关于学习ASP的20个测试题目
ASP实例教程:Server对象
ASP实例教程:Session对象
ASP实例教程:用户信息和服务器
asp教程:解决IIS安装问题
ASP网站数据库被挂木马的处理办法

ASP 中的 购物车范例(购物车页面 )


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 61 ::
收藏到网摘: n/a

  <!--checkbag.asp-->

<!--shoppingcart page-->

<%  
    response.expires = 0
    response.expiresabsolute = Now() - 1
    response.addHeader "pragma","no-cache"
    response.addHeader "cache-control","private"
    Response.CacheControl = "no-cache"
%>

<!--#include file= "conn.asp"-->
<!--#include file= "char.inc"-->

<%
    'id_type=request("id_type")
    obj=request("obj")       '用做检测是否是正常购买后的进入购物车取obj参数
    rid=session("id")         '取出会员id
    dim x,i
    dim obj_bag,bag_item,cart
           'obj_bag          ----购物车
           'bag_item        ----商品的信息数据集合
           'cart                ----一件商品的信息数据集合
    dim p_id,p_name,p_price,p_manu,p_type,p_size,p_color,p_num,p_total,sum
            'p_id               ----商品id号
            'p_name         ----商品名称
            'p_price          ----价格
            'p_manu         ----制造商
        'p_type           ----商品式样
            'p_size           ----尺寸
        'p_color          ----颜色
            'p_num           ----数量
            'p_total           ----小计
            'sum              ----合计金额

    dim id1

    if obj="1" then                                     obj为1说明由菜单栏点击进入的
        if not isobject(Session("Bag")) then            如果Session("Bag")不是对象,说明购物车为空
            response.write "<script language=""javascript"">"
            response.write"alert(""购物车为空!"");" & chr(13)
          &nbs