1
我試圖發佈從每個下拉菜單中獲得的值,這是一個n級別,但是我將使用它們的最大值爲3.我如何發佈每個我得到的值每個選擇?Dynamic Dropdowns POST
<?php
include('dbcon.php');
if($_REQUEST)
{
$id = $_REQUEST['parent_id'];
$query = "select * from ajax_categories where pid = ".$id;
$results = @mysql_query($query);
$num_rows = @mysql_num_rows($results);
if($num_rows > 0)
{?>
<select name="sub_category" class="parent">
<option value="" selected="selected">-- Sub Category --</option>
<?php
while ($rows = mysql_fetch_assoc(@$results))
{?>
<option value="<?php echo $rows['id'];?>"><?php echo $rows['category'];?></option>
<?php
}?>
</select>
<?php
}
else{echo '<label style="padding:7px;float:left; font-size:12px;">No Record Found !</label>';}
}
?>
http://www.99points.info/2010/12/n-level-dynamic-loading-of-dropdowns-using-ajax-and-php/
我想你會需要一個形式的選擇選項。你知道如何創建一個HTML表單嗎? –
嘗試使用'