代码如下:
<form method="post" action="forwork.asp%>">
<%
dim rs,sql
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from City"
rs.open sql,conn,1,1
dim i
response.Write"<table width='750' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#B0B0B0' >"
response.Write"<tr><td bgcolor='#FFFFFF'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' >"
response.Write("<tr width='100%' align='center'>国内品牌</tr>")
do while not rs.eof
i=i+1
response.write "<td width='14%' align='center'><a href=forwork.asp?city=" & replace(rs("city")," "," ") & ">" & rs("city") & "</a></td>"
if i mod 7 =0 then
response.write "<tr></tr>"
end if
rs.movenext
loop
response.Write("</td></tr>")
response.Write("</table>")
response.Write("</table>")
response.write("<input type=hidden name=Hval>")
%>
</form>
<%
dim rs2,sql2
Set rs2 = Server.CreateObject("ADODB.Recordset")
sql2="select * from trade Where Province='" & replace(request.form("Hval")," ","") & "'" '本人想在这里实现接收,以省份为条件作为选择数据Province为数据库中的字段.,但是以二楼讲的都收不到数据
rs2.open sql2,conn,1,1
dim j
response.Write"<table width='750' border='0' align='center' cellpadding='5' cellspacing='1' bgcolor='#B0B0B0' >"
response.Write"<tr><td bgcolor='#FFFFFF'><table width='100%' border='0' align='center' cellpadding='0' cellspacing='0' >"
do while not rs2.eof
j=j+1
response.write "<td width='14%' align='center'><a href='forwork.asp'>" & rs2("ComName") & "</a></td>"
if j mod 7 =0 then
response.write "<tr></tr>"
end if
rs2.movenext
loop
response.Write("</td></tr>")
response.Write("</table>")
response.Write("</table>")
%>
上面是一个在数据表读取省份~但是怎样才能实现原页面接收点击的省份数据