• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    簡單購物車教程

    發布: 2007-7-14 19:37 | 作者: 佚名    | 來源: 網絡轉載     | 查看: 8次 | 進入軟件測試論壇討論

    領測軟件測試網

    數據庫字段
    表:pro_talbe:
    id 產品編號
    proname 產品名稱
    simages 產品小圖
    表o_rder:
    id 訂單編號
    p_roid 產品編號
    m_um 產品數量
    d_time 訂購時間
    表co_table:
    id 客戶編號
    nn_ame 客戶姓名
    tt_el 聯系電話
    ee_m_ail 客戶郵箱
    +++++++++++++++++++++++
    index.asp源碼
    +++++++++++++++++++++++

    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/conn.asp" -->
    <%
    set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_conn_STRING
    Recordset1.Source = "SELECT * FROM pro_table"
    Recordset1.CursorType = 0
    Recordset1.CursorLocation = 2
    Recordset1.LockType = 3
    Recordset1.Open()
    Recordset1_numRows = 0
    %>
    <%
    Dim Repeat1__numRows
    Repeat1__numRows = -1
    Dim Repeat1__index
    Repeat1__index = 0
    Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
    %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <table width="583" border="0" cellspacing="0" cellpadding="0">
    <%
    While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
    %>
    <tr>
    <td width="140"><%=(Recordset1.Fields.Item("id").Value)%></td>
    <td width="171"><%=(Recordset1.Fields.Item("proname").Value)%></td>
    <td width="272"><%=(Recordset1.Fields.Item("simages").Value)%></td>
    <td width="272"><a href="cart.asp?ProductID=<%=(Recordset1.Fields.Item("id").Value)%>&quantity=1">購買</a></td>
    </tr>
    <%
    Repeat1__index=Repeat1__index+1
    Repeat1__numRows=Repeat1__numRows-1
    Recordset1.MoveNext()
    Wend
    %>
    </table>
    </body>
    </html>
    <%
    Recordset1.Close()
    %>
    列出產品,這里有一個要點就是:<a href="cart.asp?ProductID=<%=(Recordset1.Fields.Item("id").Value)%>&quantity=1">購買</a>
    這里傳遞了兩個參數:產品ID“ProductID" 數量:“quantity"

    +++++++++++++++++++++++++
    下面是cart.asp的源碼:
    +++++++++++++++++++++

    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/conn.asp" -->
    <%
    if not IsObject(session("cart")) then
    Set session("cart")=CreateObject("Scripting.Dictionary")
    end if
    Set cart=session("cart")
    productID=Cstr(request("productID"))
    dim detail(1)
    detail(0)=Int(request("quantity"))
    if request("productID")<>"" then
    if cart.Exists(productID) then
    cart.Remove(productID)
    end if
    cart.add productID,detail
    end if
    keys=cart.keys
    items=cart.items
    set session("cart")=cart
    %>

    <HTML>
    <HEAD>
    <TITLE>浙江廣源印刷包裝有限公司</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=gb2312">
    <LINK
    href="index/index.css" type=text/css rel=stylesheet>
    <META content="MSHTML 5.50.4807.2300" name=GENERATOR>
    </HEAD>
    <BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
    <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
    <tr>
    <td width="100%" valign="top"> <br>
    <table border="2" width="100%" cellspacing="0" cellpadding="0" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" bgcolor="#D00000" height="1" align="center">

    本新聞共4頁,當前在第1頁  1  2  3  4  

    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>