jquery ajax +php 级联列表
更新时间:2023-04-16 21:09:01 阅读量: 实用文档 文档下载
- jquery推荐度:
- 相关推荐
主页面jilian.php
/*
* Created on 2011-9-28
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include_once("fun.php");
?>
"30cf0703b52acfc789ebc909/TR/xhtml1/DTD/xhtml1-transitional.dtd">
国家
$sql="select * from Country";
$result = mysql_query($sql);
while($rs = mysql_fetch_array($result)){
?>
}
?>
省份
城市
县城
城镇
处理页面province.php
/*
* Created on 2011-9-28
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates */
include_once("fun.php");
$cid=$_POST["id"];
//$cid = 1;
$sql = "select * from Provinces where cid='".$cid."'";
$res = mysql_query($sql);
$arr8 = array();
while($r = mysql_fetch_array($res)){
$arr8[] = array($r["pid"],$r["province"]);
}
//print_r($arr8);
$str = "";
$str .= "";
for($i=0;$i $str .=" "; } echo $str; ?> city.php /* * Created on 2011-9-28 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ include_once("fun.php"); $pid=$_POST["id"]; //$cid = 1; $sql = "select * from City where pid='".$pid."'"; $res = mysql_query($sql); $arr8 = array(); while($r = mysql_fetch_array($res)){ $arr8[] = array($r["cid"],$r["city"]); } //print_r($arr8); $str = ""; $str .= ""; for($i=0;$i $str .=""; } echo $str; ?> county.php /* * Created on 2011-9-28 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ include_once("fun.php"); $cid=$_POST["id"]; //$cid = 1; $sql = "select * from County where cid='".$cid."'"; $res = mysql_query($sql); $arr8 = array(); while($r = mysql_fetch_array($res)){ $arr8[] = array($r["xid"],$r["county"]); } //print_r($arr8); $str = ""; $str .= ""; for($i=0;$i $str .=" "; } echo $str; ?> town.php /* * Created on 2011-9-28 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ include_once("fun.php"); $xid=$_POST["id"]; //$cid = 1; $sql = "select * from Town where xid='".$xid."'"; $res = mysql_query($sql); $arr8 = array(); while($r = mysql_fetch_array($res)){ $arr8[] = array($r["tid"],$r["town"]); } //print_r($arr8); $str = ""; $str .= ""; for($i=0;$i $str .=" "; } echo $str; ?> 数据库连接fun.php /* * Created on 2011-9-28 * * To change the template for this generated file go to * Window - Preferences - PHPeclipse - PHP - Code Templates */ include_once("adodb/adodb.inc.php"); mysql_connect("localhost", "root", "frotune123") or die("数据库连接失败!"); mysql_select_db("COUNTRY"); mysql_query("set names 'utf8' "); ?> 数据库:数据库名COUNTRY /* Navicat MySQL Data Transfer Source Server : 192.168.110.12_3306 Source Server Version : 50152 Source Host : 192.168.110.12:3306 Source Database : COUNTRY Target Server Type : MYSQL Target Server Version : 50152 File Encoding : 65001 Date: 2011-09-29 15:38:27 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for `City` -- ---------------------------- DROP TABLE IF EXISTS `City`; CREATE TABLE `City` ( `cid` int(2) NOT NULL AUTO_INCREMENT, `pid` int(2) NOT NULL, `city` varchar(20) NOT NULL, PRIMARY KEY (`cid`) ) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of City -- ---------------------------- INSERT INTO City V ALUES ('1', '1', '石家庄'); INSERT INTO City V ALUES ('2', '1', '衡水'); INSERT INTO City V ALUES ('3', '1', '保定'); INSERT INTO City V ALUES ('4', '2', '郑州'); INSERT INTO City V ALUES ('5', '2', '洛阳'); INSERT INTO City V ALUES ('6', '2', '驻马店'); INSERT INTO City VALUES ('7', '3', '苏州'); INSERT INTO City V ALUES ('8', '3', '宿迁'); INSERT INTO City V ALUES ('9', '3', '南京'); INSERT INTO City V ALUES ('10', '4', '长沙'); INSERT INTO City V ALUES ('11', '4', '衡阳'); INSERT INTO City V ALUES ('12', '4', '张家界'); INSERT INTO City VALUES ('13', '5', '亚拉巴马州'); INSERT INTO City V ALUES ('14', '5', '阿拉斯加州'); INSERT INTO City V ALUES ('15', '5', '亚利桑那州'); INSERT INTO City V ALUES ('16', '6', '阿肯色州'); INSERT INTO City V ALUES ('17', '6', '加利福尼亚州'); INSERT INTO City V ALUES ('18', '6', '科罗拉多州'); INSERT INTO City V ALUES ('19', '7', '特拉华州'); INSERT INTO City V ALUES ('20', '7', '佛罗里达州'); INSERT INTO City V ALUES ('21', '8', '温哥华'); INSERT INTO City V ALUES ('22', '9', '埃德蒙顿市'); INSERT INTO City V ALUES ('23', '10', '瑞吉娜'); -- ---------------------------- -- Table structure for `Country` -- ---------------------------- DROP TABLE IF EXISTS `Country`; CREATE TABLE `Country` ( `cid` int(2) NOT NULL AUTO_INCREMENT, `country` varchar(20) DEFAULT NULL, PRIMARY KEY (`cid`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of Country -- ---------------------------- INSERT INTO Country VALUES ('1', '中国'); INSERT INTO Country VALUES ('2', '美国'); INSERT INTO Country VALUES ('3', '加拿大'); -- ---------------------------- -- Table structure for `County` -- ---------------------------- DROP TABLE IF EXISTS `County`; CREATE TABLE `County` ( `xid` int(2) NOT NULL AUTO_INCREMENT, `cid` int(2) NOT NULL, `county` varchar(20) NOT NULL, PRIMARY KEY (`xid`) ) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of County -- ---------------------------- INSERT INTO County V ALUES ('1', '1', '正定县'); INSERT INTO County V ALUES ('2', '2', '景县'); INSERT INTO County V ALUES ('3', '3', '保定的县'); INSERT INTO County V ALUES ('4', '4', '郑州的县'); INSERT INTO County V ALUES ('5', '5', '洛阳的县'); INSERT INTO County V ALUES ('6', '6', '驻马店的县'); INSERT INTO County V ALUES ('7', '7', '昆山'); INSERT INTO County V ALUES ('8', '8', '宿迁的县'); INSERT INTO County V ALUES ('9', '9', '南京的县'); INSERT INTO County V ALUES ('10', '10', '长沙的县'); INSERT INTO County V ALUES ('11', '11', '衡阳的县'); INSERT INTO County V ALUES ('12', '12', '张家界的县'); INSERT INTO County V ALUES ('13', '13', '亚拉巴马'); INSERT INTO County V ALUES ('14', '14', '阿拉斯加'); INSERT INTO County V ALUES ('15', '15', '亚利桑那'); INSERT INTO County V ALUES ('16', '16', '阿肯色'); INSERT INTO County V ALUES ('17', '17', '加利福尼亚'); INSERT INTO County V ALUES ('18', '18', '科罗拉多'); INSERT INTO County V ALUES ('19', '19', '特拉华'); INSERT INTO County V ALUES ('20', '20', '佛罗里达的县'); INSERT INTO County V ALUES ('21', '21', '温哥华的县'); INSERT INTO County V ALUES ('22', '22', '埃德蒙顿'); INSERT INTO County V ALUES ('23', '23', '瑞吉娜的县'); -- ---------------------------- -- Table structure for `Provinces` -- ---------------------------- DROP TABLE IF EXISTS `Provinces`; CREATE TABLE `Provinces` ( `pid` int(2) NOT NULL AUTO_INCREMENT, `cid` int(2) NOT NULL, `province` varchar(20) NOT NULL, PRIMARY KEY (`pid`) ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of Provinces -- ---------------------------- INSERT INTO Provinces V ALUES ('1', '1', '河北'); INSERT INTO Provinces V ALUES ('2', '1', '河南'); INSERT INTO Provinces V ALUES ('3', '1', '江苏'); INSERT INTO Provinces V ALUES ('4', '1', '湖南'); INSERT INTO Provinces V ALUES ('5', '2', '新英格兰地区'); INSERT INTO Provinces V ALUES ('6', '2', '中央地区'); INSERT INTO Provinces V ALUES ('7', '2', '中大西洋地区'); INSERT INTO Provinces V ALUES ('8', '3', '不列颠哥伦比亚省'); INSERT INTO Provinces V ALUES ('9', '3', '阿尔伯塔省'); INSERT INTO Provinces V ALUES ('10', '3', '萨斯喀彻温省'); -- ---------------------------- -- Table structure for `Town` -- ---------------------------- DROP TABLE IF EXISTS `Town`; CREATE TABLE `Town` ( `tid` int(2) NOT NULL AUTO_INCREMENT, `xid` int(2) NOT NULL, `town` varchar(20) NOT NULL, PRIMARY KEY (`tid`) ) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; -- ---------------------------- -- Records of Town -- ---------------------------- INSERT INTO Town V ALUES ('1', '1', '正定的镇'); INSERT INTO Town V ALUES ('2', '2', '杜桥'); INSERT INTO Town V ALUES ('3', '2', '龙华'); INSERT INTO Town V ALUES ('4', '3', '保定的镇'); INSERT INTO Town V ALUES ('5', '4', '郑州的镇'); INSERT INTO Town V ALUES ('6', '5', '洛阳镇'); INSERT INTO Town V ALUES ('7', '6', '驻马镇'); INSERT INTO Town V ALUES ('8', '7', '花桥'); INSERT INTO Town V ALUES ('9', '7', '陆家'); INSERT INTO Town V ALUES ('10', '8', '宿迁的镇'); INSERT INTO Town V ALUES ('11', '9', '南京的镇'); INSERT INTO Town V ALUES ('12', '10', '长沙的镇'); INSERT INTO Town V ALUES ('13', '11', '衡阳镇'); INSERT INTO Town V ALUES ('14', '12', '张家界镇'); INSERT INTO Town V ALUES ('15', '13', '亚拉巴马镇'); INSERT INTO Town V ALUES ('16', '14', '阿拉斯加镇'); INSERT INTO Town V ALUES ('17', '15', '亚利桑纳镇'); INSERT INTO Town V ALUES ('18', '16', '阿肯色镇'); INSERT INTO Town V ALUES ('19', '17', '加利福尼亚镇'); INSERT INTO Town V ALUES ('20', '18', '科罗拉多镇'); INSERT INTO Town V ALUES ('21', '19', '特拉华镇'); INSERT INTO Town V ALUES ('22', '20', '佛罗里达镇'); INSERT INTO Town V ALUES ('23', '21', '温哥华镇'); INSERT INTO Town V ALUES ('24', '22', '埃德蒙顿镇'); INSERT INTO Town V ALUES ('25', '23', '瑞吉娜镇'); 效果图:
正在阅读:
中国多媒体教学学报中学数学05-19
电工必备常识知识01-14
财政学习题精选-总复习用-2012修改版04-26
学习弟子规心得体会600字07-16
2016-2017新教材苏教版二年级数学下册全册教案04-29
《上将洪学智》观后感12-11
诚信作文450字06-19
药物毒副反应判定标准07-27
房屋面积测量知识简介05-03
- 教学能力大赛决赛获奖-教学实施报告-(完整图文版)
- 互联网+数据中心行业分析报告
- 2017上海杨浦区高三一模数学试题及答案
- 招商部差旅接待管理制度(4-25)
- 学生游玩安全注意事项
- 学生信息管理系统(文档模板供参考)
- 叉车门架有限元分析及系统设计
- 2014帮助残疾人志愿者服务情况记录
- 叶绿体中色素的提取和分离实验
- 中国食物成分表2020年最新权威完整改进版
- 推动国土资源领域生态文明建设
- 给水管道冲洗和消毒记录
- 计算机软件专业自我评价
- 高中数学必修1-5知识点归纳
- 2018-2022年中国第五代移动通信技术(5G)产业深度分析及发展前景研究报告发展趋势(目录)
- 生产车间巡查制度
- 2018版中国光热发电行业深度研究报告目录
- (通用)2019年中考数学总复习 第一章 第四节 数的开方与二次根式课件
- 2017_2018学年高中语文第二单元第4课说数课件粤教版
- 上市新药Lumateperone(卢美哌隆)合成检索总结报告
- jquery
- 列表
- ajax
- php
- 土木工程专业英语(苏小卒)课文翻译13、15、17、18单元资料讲解
- 蓝宝GRE笔考词汇突破核心词汇
- 雨季施工安全监理细则
- 浅谈北国超市市场营销策划
- 2022成人高考专升本《民法》考点速记(4)_2000
- 房屋建筑结构课程设计——某七层办公楼混凝土全现浇框架结构
- 辽宁省大连市2022_2022学年高一政治上学期期中试题无答案(新)
- 120305附件十二、施工合同(SG-A-I-011)(1)
- 从营销开始变革打造解决方案导向型企业
- 2022-2022年中国铸铁管产业发展态势及十三五发展态势预测报告(目
- 八年级生物上册 17.2 动物的行为学案1(新版)苏科版
- 怎样提高演讲稿写作技巧:
- 餐饮管理有限公司员工手册
- 上海市实施《中华人民共和国防震减灾法》办法(公告第16号)
- 2022-2025年中国工业汽轮机行业发展前景预测及投资战略研究报告
- 食品经营验收申请表
- 2022年西安外国语大学企业管理841管理学之《组织行为学》考研必
- 全球气候变暖对自然环境的影响
- 六年级下册语文《汤姆索亚历险记记》练习及答案教学文稿
- 四年级英语新课程标准