asp 站内的搜索问题
遇到的问题是写了出来之后测试不可以使用,自己找不出来错误了,需要各位大大帮忙
代码如下:
<%这是头部代码
ProvinceID=Request("province")
%>
<form action="?" name="frm" method="post">
<input type="hidden" name="action" value="search" />
<td width="258" height="60"> </td>
<td width="52" class="font14hui">区域:</td>
<td width="3"></td>
<td width="247"><select name="province">
<%
Sql="Select provinceID,province From T_Province"
SetRs Rs,Sql,conn,1,1
Do While Not Rs.eof
%>
<option value="<%=Rs("ProvinceID")%>" <%IF Cstr(Rs("provinceID"))=Cstr(provinceID) Then Response.Write("selected")%>><%=Rs("Province")%></option>
<%
Rs.movenext
Loop
DisRs Rs
%>
</select></td>
<td width="1"></td>
<td width="406"><input type="image" name="btnSearch" src="images/search.jpg" /></td>
<td width="23"> </td></form>
ProvinceID=Request("province")
response.write ProvinceID'输出看看有指没有
cd=""
if isnumeric(ProvinceID&"") then'''''''
cd=" where ProvinceID="&ProvinceID
end if
sql="select * from table"&cd'''''''
<%
Dim ProvinceID
ProvinceID=Int(Trim(Request.Form("province")))
%>
<form action="" name="frm" method="post">
<input type="hidden" name="action" value="search" />
<td width="258" height="60"> </td>
<td width="52" class="font14hui">区域:</td>
<td width="3"></td>
<td width="247"><select name="province">
<%
Set Rs=Server.CreateOBject("ADODB.RecordSet")
Sql="Select provinceID,province From T_Province"
Rs,Sql,conn,1,1
Do While Not Rs.eof
%>
<option value="<%=Rs("ProvinceID")%>" <%IF Cstr(Rs("provinceID"))=Cstr(provinceID) Then Response.Write("selected")%>><%=Rs("Province")%></option>
<%
Rs.movenext
Loop
DisRs Rs
%>
</select></td>
<td width="1"></td>
<td width="406"><input type="image" name="btnSearch" src="images/search.jpg" /></td>
<td width="23"> </td></form>
<%
Rs.movenext
Loop
DisRs Rs
%>
</select></td>
<td width="1"></td>
<td width="406"><input type="image" name="btnSearch" src="images/search.jpg" /></td>
<td width="23"> </td></form>