<% dim conn, rs set conn = server.createobject("ADODB.Connection") set conn = connectDB() set rs = Server.CreateObject("ADODB.recordset") id = request("id") select_cat = request("select_cat") ' sql = "select * from product where id = " & id sql = "select pdt.id, pdt.item_no, pdt.pic1, pdt.pic2, pdt.pic3, pdt.features, pdt.spec, pcat.title from product as pdt, product_cat as pcat where pdt.product_cat_id = pcat.id and pdt.id = " & id rs.Open sql, conn, 1, 3 if not rs.EOF then title = " >    " & rs("title") end if ' Add item into shopping cart if request("addtocart") = "1" then if Request.Cookies("userid") = "" then userid="" A = Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z") for i=1 to 10 Randomize userid = userid & A(Int((35 * Rnd))) next Response.Cookies("userid") = userid Response.Cookies("userid").Expires=#October 8,2037# end if product_added = 0 sql2 = "select * from mycart where product_id = '"&id& "' and user_id = '"&Request.Cookies("userid")&"'" set rs2=Server.CreateObject("ADODB.recordset") rs2.Open sql2, conn, 1, 3 DO WHILE NOT rs2.EOF product_added = 1 display_msg = "Product already added before." rs2.moveNext LOOP set rs2=nothing if product_added = 0 then sql = "insert into mycart (user_id, product_id) " &_ "values ('"&Request.Cookies("userid")&"', " & id & ")" conn.execute sql display_msg = "Product have been added in you cart." end if end if %> FIDEK PURITY OF SOUND <% if display_msg <> "" then %> <% else %> <% end if %>
<% if select_cat = "1" then %> <% elseif select_cat = "2" then %> <% end if %>
  <%= title %>
  <%= title %>
 
" width="227" height="192" border="0">
<% if rs("pic2") <> "" then %>
" width="227" height="192" border="0">
<% end if %> <% if rs("pic3") <> "" then %>
" width="227" height="192" border="0"> <% end if %>
<%= rs("item_no") %>
Features:
<%= replace(rs("features"), chr(10), "
")%>
<% if rs("spec") <> "" then %> " target="spec"> <% end if %>
 

       
 
<% conn.close() set conn = nothing set rs = nothing %>