建一个area的表,然后建一个上级地区字段 bareaid
把下列代码加入到管理bareaid字段的输入表单替换html代码中
<select name="bareaid" id="bareaid">
<option value=""<?=$r[bareaid]==""?' selected':''?>>顶级地区</option>
<?php
$result = mysql_query("SELECT id,title,bareaid FROM phome_ecms_area where bareaid = '' ");
while($row = mysql_fetch_array($result))
{
?>
<option value="<?php echo $row['id'] ?>"<?php if($r["bareaid"]==$row['id']){ echo "selected='selected'"; }?>><?php echo $row['title'] ?></option>
<?php
}
?>
</select>