我在ORACLE数据库里有一表BoardInfo,内有字段BoardID,BoardName两种。已写好以下的代码,但问题是按“GO”钮时如何传递BoardID参数,并能跳转到该版块的页面。
<%
String BoardName="";
sql="select * from BoardInfo";
rs=conn.executeQuery(sql);
while (rs!=null && rs.next())
{
BoardName=BoardName+"<option id='"+rs.getString("BoardID")+"'"+" value='"+rs.getString("BoardID")+"'>"+rs.getString("BoardName")+"</option>";
}
if(rs!=null) rs.close();
//out.println(BoardName);
String bbsBoard="<select name='Name_select' id='Name_select' style='width:100px'>"+BoardName+"</select>";%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<form name="form2" action="forum_list.jsp?BoardID=" method="post">
<td align="center">
<%=bbsBoard%>
<input type="submit" name="sub" id="sub" value="GO" class="go">
</td>
</form>
</tr>
</table>
<%
String BoardName="";
sql="select * from BoardInfo";
rs=conn.executeQuery(sql);
while (rs!=null && rs.next())
{
BoardName=BoardName+"<option id='"+rs.getString("BoardID")+"'"+" value='"+rs.getString("BoardID")+"'>"+rs.getString("BoardName")+"</option>";
}
if(rs!=null) rs.close();
//out.println(BoardName);
String bbsBoard="<select name='Name_select' id='Name_select' style='width:100px'>"+BoardName+"</select>";%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<form name="form2" action="forum_list.jsp?BoardID=" method="post">
<td align="center">
<%=bbsBoard%>
<input type="submit" name="sub" id="sub" value="GO" class="go">
</td>
</form>
</tr>
</table>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货