<% connect_db() %> <% Dim id Dim rs2 Dim catalog_name Dim new_product_catalog_id id = Request("id") If (Not isNumeric(id)) Or id = "" Then goBack("Parameter Error") End If id = CLng(id) sql = "select * from products where flag = 0 and id = " & id Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql, conn, 3 If rs.BOF And rs.EOF Then goBack("The product is not exists!") End If new_product_catalog_id = rs("catalog_id") sql = "select * from product_catalogs where id = " & rs("catalog_id") Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.Open sql, conn, 3 If rs1.BOF And rs1.EOF Then goBack("The product is not exists!") End If catalog_name = rs1("catalog_name") new_catalog_id = rs1("id") sql = "update products set click_times = click_times + 1 where flag = 0 and id = " & id Set rs2 = Server.CreateObject("ADODB.Recordset") rs2.Open sql, conn, 3 %>
Home > Products

 

" border="0" id="mypic">
<% Dim str_style sql = "select * from products where catalog_id = " & new_product_catalog_id & " and flag = 0 order by id" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql, conn, 3 %> <% i = 0 If Not (rs.BOF And rs.EOF) Then While (Not rs.EOF) And (i < 12) str_style = "border: 0px;" If rs("id") = id Then str_style = "border: solid 3px green" End If %> <% If Not rs.EOF Then i = i + 1 rs.MoveNext End If Wend End If %>
#pic">" style="<%=str_style%>" width="200" height="100">
<% If Not rs.EOF Then i = i + 1 rs.MoveNext End If If Not rs.EOF Then str_style = "border: 0px;" If rs("id") = id Then str_style = "border: solid 3px green" End If %>
#pic">" style="<%=str_style%>" width="200" height="100">
<% Else Response.Write " " End If %>
<% If Not rs.EOF Then i = i + 1 rs.MoveNext End If If Not rs.EOF Then str_style = "border: 0px;" If rs("id") = id Then str_style = "border: solid 3px green" End If %>
#pic">" style="<%=str_style%>" width="200" height="100">
<% Else Response.Write " " End If %>