pro_city.php Initial page: < title>Provincial and municipal secondary linkage < ;/script><br> <script type="text/javascript"><br> $(document).ready(function(){<br> ").load("show.php?id="+$("#province").val());<br> Cascade linkage</span><br/><br> <select name="province" id="province"><br> <option value="-1">Please select a province</option><br> <?php<br/> $conn = mysql_connect("localhost","root","root"); //Connect to the database<br/> mysql_query("set names utf8");<br/> mysql_select_db("bbs");<br/> $rs = mysql_query ("select id,cname,parentid from areas where parentid='0'");<br/> while($row = mysql_fetch_array($rs))<br/> {<br/>?><br> <option value="<?php echo $ row['id']?>"><?php echo $row['cname']?></option><br><?php<br/> }<br/>?><br> </select><br> < /select><br> </span><br></body><br></html><br><br>show.php<br><br><?php<br/> header("content-type:text/html;charset=utf-8" );<br/><br/> $province_id = $_GET['id'];<br/> if($province_id=='10000000' || $province_id=='11000000' || $province_id=='18000000' || $province_id==' 31000000')<br/> {<br/> ={$province_id}"; <br/> }<br/><br/> $conn = mysql_connect("localhost","root","root"); ;<br/> $rs = mysql_query($sql);<br/><br/> $show = "<select name='city1' id='city1'>";<br> while($row = mysql_fetch_array($rs))<br> {<br> $ show .= "<option value=".$row['id'].">".$row['cname']."</option>";<br> }<br> $show .= "< /select>";<br><br> if($province_id=='-1') //When "Please select a province" is selected, the city list displays "Please select a city"<br> {<br> $show="<select><option> ;Please select a city</option></select>";<br> }<br> echo $show; //Return the string to display on the page<br>?><br></p>