先看coding,
................................................
下面是 sernbacer.asp 显示出来的画面
--------------------------------------------------------------------
------------------------------------------------------------------------------
sernbacer.asp
------------------------------------
<%Response.ContentType ="text/vnd.wap.wml"%>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="Acer Laptop">
<%
Set MyConn=Server.CreateObject("ADODB.Connection")
Myconn.Open "DSN=try"
Set RS=MyConn.Execute("SELECT * FROM product WHERE type ='pc' AND brand = 'acer'")
If rs.eof Then
%>
<p>
<% response.write(" No ACER Laptop found") %>
<do type="prev" label="Back"><prev/></do>
</p>
<%
Else
while not rs.eof
%>
<p>
<% response.write("<strong>"&RS("pname")&" </strong>")%><br/>
<% response.write("<strong>Product ID:</strong>" &RS("pid"))%>
////////////////////////////// 问题来了, 对于上面两行coding,是将数据库里面符合用户搜索条件的资料显示出来,上面一行显示的是产品名称,下面一行,显示的是产品ID,这个画面,可以在上面的那张图片里面看见, 我得问题是,如何将这个产品ID在pass一次到一个detail.asp文件里面,您们可以看那个贴图,就是说,在产品ID右边有 >>> 这个连接,我想通过这个连接,在用户点击后,可以看见产品的完整信息,比如显示出 产品库存多少, 产品简介,产品其他信息......就像这样, ............... 或者 直接就把 刚刚显示出来的那个产品ID连接到detail.asp文件,那会更好.... 以下是我自己的设想,因为在注册用户时,我用了这样的pass value的方法,将用户输入的基本资料,存到数据库了,但是在这里,我不知道要如何才能传递那个ID的值,希望达人们,帮帮我,谢谢了........//////////////////////////////////
<anchor>>>><go href="detail.asp?pid=$(pid)" method="post" />
</anchor><br/>
<a href="wantorder.asp">Want Order</a><br/>
------------------------
</p>
<%
RS.MoveNext
WEND
END IF
%>
<p>
<do type="prev" label="Back"><prev/></do>
<br/>
<a href="aftcuslog.wml">Back to Home</a>
</p>
<%
RS.Close
MyConn.Close
%></card></wml>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
detail.asp
---------------------------------
<%Response.ContentType ="text/vnd.wap.wml"%>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card title="detail">
<%
dim a
a=Request.QueryString("pid")
\\\\\\\\\\\\\\\\\\\\以上的这个,就是想把刚刚从上个页面pass下来的产品ID的值记录在这个页面,然后通过产品ID(因为它是一个主键primary key),在在数据库里面搜索这个产品的其他信息... 不知道我说清楚没,希望知道的大哥们,帮帮忙,小弟这个破系统交不出,就完蛋了.谢谢,感激不尽!!!/////////////////////////////////////////
Set MyConn=Server.CreateObject("ADODB.Connection")
Myconn.Open "DSN=try"
Set RS=MyConn.Execute("SELECT * FROM product WHERE pid ='"& a& "'")
If rs.eof Then
%>
<p>
<% response.write(" There is no detail information of the product found") %>
<a href="search.wml">Ok</a> <br/>
</p>
<%
Else
while not rs.eof
%>
<p>
<% response.write("<strong>"&RS("pname")&" </strong>")%><br/>
<% response.write("<strong>Product ID:</strong>" &RS("pid"))%><br/>
<% response.write("<strong>Stock:</strong>" &RS("stock"))%><br/>
<% response.write("<strong>Price(RM):</strong>" &RS("price"))%><br/>
<% response.write("<strong>Comment:</strong>" &RS("comment"))%><br/>
<a href="wantorder.asp">Want Order</a><br/>
------------------------
</p>
<%
RS.MoveNext
WEND
END IF
%>
<p>
<a href="search.wml">Back</a><br/>
<a href="aftcuslog.wml">Back to Home</a>
</p>
<%
RS.Close
MyConn.Close
%></card></wml>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
谢谢