少妇伦子伦精品无码,国产JJIZZ女人多水免费,А√最新版天堂资源在线,国产成人午夜精品一区二区三区

專業(yè)的廣州網(wǎng)站建設(shè)公司、廣州網(wǎng)站設(shè)計(jì)制作公司為您服務(wù),電話:020-85548809,29883069
新聞中心
專業(yè)專注專心,行業(yè)行情行規(guī)
分享交流,永無止境,我們?cè)概c您共同進(jìn)步

ASP購(gòu)物車代碼超級(jí)簡(jiǎn)單

發(fā)布日期:[2010/10/28]   編輯:奇億廣州網(wǎng)站建設(shè)

將以下ASP購(gòu)物車代碼都保存為一個(gè)文件,如cart.asp,調(diào)用時(shí)比如加入購(gòu)物車直接使用鏈接cart.asp?id=商品ID即可。本例中商品數(shù)據(jù)庫(kù)表為product,使用到商品ID,商品名稱product_name等,在實(shí)際使用ASP購(gòu)物車代碼時(shí)將相關(guān)參數(shù)替換下。
<%'簡(jiǎn)單ASP購(gòu)物車代碼原理
action=request.QueryString("action")
if request.QueryString("id")="" then
bookid=session("productlist")'//////////////////////////////////調(diào)入查詢物品的id
else
  if session("productlist")="" then
session("productlist")=request.QueryString("id")
bookid=request.QueryString("id")
  else
    if instr(request.querystring("id"),session("productlist"))<1 then
bookid=session("productlist")+","+request.QueryString("id")'//////////////把id全部存儲(chǔ)到bookid中類似與數(shù)組
session("productlist")=bookid
    else
bookid=session("productlist")
    end if
  end if
end if

if session("productlist")="" then'////////////////////////若id為空,則說明用戶沒有購(gòu)物
bookid=0
end if

if action="del" then '刪除購(gòu)物車中的某一件商品
aProducts=split(Session("ProductList"),",")
delid=cstr(trim(Request.QueryString("id")))
For i=0 To UBound(aProducts)    '循環(huán)所有商品ID
    If trim(aProducts(i))<>delid then
        '不等于被刪除的ID時(shí)則保存進(jìn)新的列表中
        sNewProducts = sNewProducts & "," & aProducts(i)
    end if
Next
Session("ProductList") = mid(sNewProducts,2)
  if session("ProductList")="" then
bookid=0
  else
bookid=Session("ProductList")
  end if
end if
%>

以下是ASP購(gòu)物車?yán)锏乃猩唐罚?lt;br><br>
<%'根據(jù)臨時(shí)存儲(chǔ)到SESSION里的商品ID分別從商品數(shù)據(jù)庫(kù)循環(huán)調(diào)出商品顯示到購(gòu)物車頁(yè)面,遇到重復(fù)ID不顯示
if bookid<>0 and bookid<>"" then
set rs=server.CreateObject("adodb.recordset")
dim sql
sql="select id,product_name from product where id in ("&bookid&") order by id" '這里替換成實(shí)際的商品數(shù)據(jù)庫(kù)及字段
rs.open sql,conn,1,1
   dim bookscount,books '定義判斷有幾個(gè)bookid
   bookscount=request.QueryString("id").count
   aa=1
   do while not rs.eof
   dim quatity '判斷input 名
Quatity = CInt( Request( "ckxp"&rs("id")) )
If Quatity <=0 Then Quatity = 1
'以下為購(gòu)物車每一件商品內(nèi)容,包含ID、名稱、數(shù)量及取消
%>

商品ID:<%=rs("id")%>
商品名稱:<a href="showproduct.asp?id=<%=rs("id")%>" title="<%=rs("info")%>" target="_blank"><%=rs("product_name")%></a>
訂購(gòu)數(shù)量:<input name="sl<%=aa%>" type="text" Value="1" size="3">
取消商品:<a href="?nav=m&id=<%=rs("id")%>&action=del"><font color="#FF0000" size="4" style="font-weight:bold">×</font></a>
<br>

<%'循環(huán)讀取ASP購(gòu)物車內(nèi)的商品
rs.movenext
aa=aa+1
loop
rs.close
set rs=nothing
%>
<%if bookid=0 or bookid="" then%>ASP購(gòu)物車內(nèi)沒有商品,請(qǐng)選擇需訂購(gòu)的商品。<%end if%>

廣州建網(wǎng)站、廣州做網(wǎng)站
或者將本文《ASP購(gòu)物車代碼超級(jí)簡(jiǎn)單》收藏和分享到:
復(fù)制本文《ASP購(gòu)物車代碼超級(jí)簡(jiǎn)單》地址給好友:
你的东西太大了我装不了| 清纯校花挨脔日常H| 亚洲精品中文字幕| 精品熟女60老妇av免| 久久久久免费精品国产| 精品无码三级在线观看视频| 国产一区二区在线视频| 欧美牲交a欧美牲交| 久久精品国产精品亚洲精品| 小12箩利洗澡无码视频网站| 重口老太大和小伙乱| 女人和拘做受全过程免费| 色婷婷久久综合丁香五月狠狠野花| 精品人妻伦九区久久AAA片| 国产人妻久久精品一区二区三区| 久久人人爽人人爽人人片AV| 日本理论片| 精品久久久久久中文字幕人妻最新 | 免费看男男GAY啪啪网站| 精品一二三区久久AAA片| 农村嫖妓CHINESE城中村| 高H喷水荡肉爽文NP肉色学校| 99久久精品费精品蜜臀av| 初尝人妻少妇中文字幕| 超碰97久久国产精品牛牛| 伸进去摸老妇的毛| 小舞屈辱打开双腿自慰出白浆| 免费高清理伦片A片在线观看| 日韩精品一区二区亚洲av观看 | 久久精品国产亚洲AV无码麻豆| 亚洲国产精品无码久久98| 富婆如狼似虎找黑人老外| 囯产精品久久久久久久久蜜桃| 国产av躁一二三区免费播放| 精品一区二区三区无码视频 | 中文精品久久久久人妻不卡| 中文字幕乱码在线人视频| 日本理伦片午夜理伦片| 啊灬用力灬啊灬啊灬啊灬A片| 法国艳妇LARALATEX| 特级毛片WWW|