一个简单的网上书城的例子(三)

2018-09-06 12:16

阅读:415

  buy.asp:显示商品和用户购物!

<!--#include file="Util.asp" -->
<%
DbPath = SERVER.MapPath("ShopBag.mdb")
conn.open "driver={Microsoft access(小型网站之最爱) Driver (*.mdb)};dbq=" DbPath

CategoryID=Request("CategoryID")
Description=Request("Description")
Head="会文书城[" Description "] 区"

sql = "Select * From Products Where CategoryID=" CategoryID
sql = sql " Order By ProductID"
Set rs = conn.Execute( sql )

%>


<HTML>
<HEAD><TITLE><%=Head%></TITLE></HEAD>
<BODY BACKGROUND="b01.jpg">
<font color=blue><H2 ALIGN=CENTER><%=Head%></H2></font>
<CENTER>
<Form Action=Add.asp Method=POST>
<TABLE Border=1>
<TR BGCOLOR=#00FFFF>
<TD>挑选</TD><TD>书刊编号</TD><TD>书刊名称</TD><TD>价格</TD><TD>书刊简介</TD></TR>
<%
While Not rs.EOF
IsCheck=""
If InStr(Session("ProductList"), rs("ProductID")) > 0 Then
IsCheck="Checked"
End If
%>
<TR>
<TD Align=Center>
<Input Type=CheckBox Name="ProductID" Value="<%=rs("ProductID")%>" <%=IsCheck%>>
</TD>

<TD><%=rs("ProductID")%></TD>
<TD><%=rs("ProductName")%></TD>
<TD Align=Right><%=rs("Price")%></TD>
<TD><A HREF=<%=rs("Link")%>><%=rs("Description")%></A></TD>
</TR>
<%
rs.MoveNext
Wend
%>
</TABLE>
<Input Type=Submit Value="放入购物袋">
</Form>
<HR width=70%>
<A HREF=Check.asp>查看购物袋</A>
<A HREF=Clear.asp>退回所有物品</A><P>
<% ListCategory conn %>
</CENTER>
</BODY>
</HTML>



评论


亲,登录后才可以留言!