您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

用php实现真正的----连动下拉列表

2024/4/21 0:40:10发布13次查看
下拉|下拉列表
下面的两个文件copy到同一个文件下,通过web路径访问index.html看看吧,这个是通过iframe来实现的连动更新,list.php目前的内容比较简单,你看通过list.php来进行数据库查询,然后显示出查询的结果列表。
index.html
请选择...
北京
通化
list.php
array(小强,旺财,小强他爹),
               通化=>array(小温,小宋,他们儿子),);
 $city = $_get[city];
 $result = $data[$city];
 $str =
 if($result==null)
  $str .= tmp = new option(\......\, \\);list.options[0] = tmp;;
 else
  foreach($result as $i => $value)
   $str .= tmp = new option(\{$value}\, \{$value}\);list.options[$i] = tmp;;
 $str .= ;
echo $str;
?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product