PutToShopBag Products
'Session("ProductList") = ProductList
ProductList = Session("ProductList")
dim idArray(100),numArray(100),myprize
myprize=getprize(id)
if request.form("submit")="确定购物" then
for i=1 to ubound(split(ProductList,", ",-1,1))
if isnumeric(myprize(id)) then '判断价格是否为数字
idArray(i)=trim(request.form("id"&i))
numArray(i)=trim(request.form("num"&i))
response.write idArray(i)&" "&numArray(i)&"<br>"
end if'判断价格是否为数字
next
end if
Sub PutToShopBag( ProductID )
isrepeat=0
if ProductID="" or not isnumeric(ProductID) then
exit sub
end if
for i=lbound(split(Session("ProductList"),", ",-1,1)) to ubound(split(Session("ProductList"),", ",-1,1))
mystring1=split(Session("ProductList"),", ",-1,1)
if mystring1(i)=ProductID then
isrepeat=1
exit for
else
isrepeat=0
end if
next
if isrepeat=0 then
Session("ProductList") = Session("ProductList") & ", " & ProductID & ""
end if
End Sub
___________上面的程序是通过产品id,把产品放进购物车中,而价格也是通过得到的. 问题是:我想在把产品放里购物车时,先判断一个价格是否为数字,非数字的就不放进购物车.麻烦兄弟们帮我看看.
自己up,
没人知道吗??各位大哥帮帮忙.....谢咯.
其实购物车就是把商品ID和数量还有订单者的ID保存在数据库里,查看订单时就通过商品ID来获知商品的价格、名称等属性,用户的详细资料就通过订单者ID来获知,当然也可以再提交购物车时让用户填写真实资料。至于判断价格那就不太必要,因为价格是从商品表里对应取出来的。
if ismumber(XX) then '数字
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 问题 购物车 if ProductList 价格 数字 then Session |
注册
个人空间
