php+javascriptで二級カスケードメニューの製作を実現します。


大体の考えはこのようです。前のページを更新しないために、私はiframeで二級の副ページに潜り込んで、データベースの中のデータを読み取ります。最後に欲しいデータを親ページに渡して、データの選択と転送を完成します。主なプログラムコードは以下の通りです。 src="city.php" width="300" height="22" frame border="0" scrolling="no"  サブページcity.php:<スクリプト laguage="javascript" type="text/javascript">function goto(n){this.locations.href=]city.php?sh_id="+n;"所在地の省市を選んでください。php include_オンス("db.php");sql="select * from province order by shid。 asc";reult=mysql_query($sql)while($row=mysql_)fetchassioc($result){?}<?オプト value="< echo $row[]sh_id「?」 あなたがいる都市を選択します。php if(empty($uGET[]shuid){//echo “ok;sql="select * from シティ where shid=".$uGET[]shuid"." order by シティid。 asc";reult=mysql_query($sql)while($row=mysql_)fetchassioc($result){?}<?オプト value="< echo $row[]city_name";?">< echo $row[]city_name"?"?""option>