热门资讯

你看通过listsbf123手机版.php来进行数据库查询

下面的两个文件copy到同一个文件下,通过web路径访问index.html看看吧,这个是通过iframe来实现的连动更新,list.php目前的内容比较简单,你看通过list.php来进行数据库查询,然后显示出查询的结果列表。index.htmlbodyform
name=”myfrm”select name=”mlist” onchange=”changes();”option
value=”0″请选择…/optionoption value=”北京”北京/optionoption
value=”通化”通化/option/selectnbsp;select name=”slist”/selectiframe
src=”list.php?city=” /iframescript language=”javascript”function
changes(){ frame.location.href = “list.php?city=”
document.myfrm.mlist.value;}/script/form/bodylist.php?php $data =
array(“北京”=array(“小强”,”旺财”,”小强他爹”),
“通化”=array(“小温”,”小宋”,”他们儿子”),); $city = $_GET[“city”];
$result = $data[$city]; $str = “script language=”javascript”list =
parent.document.myfrm.slist;list.length = 0;”; 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 .= “/script”; echo $str;?

发表评论

电子邮件地址不会被公开。 必填项已用*标注

相关文章