Home  >  Article  >  Backend Development  >  Application example of ajax+php secondary linkage menu without refreshing_PHP tutorial

Application example of ajax+php secondary linkage menu without refreshing_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:57:521118browse

This php ajax application example uses ajax+php to call the city's secondary linkage menu, so that we can update it in real time based on the database content.

This php tutorial ajax application example uses ajax+php to call the city's secondary linkage menu, so that we can update the content of the database tutorial in real time.



Ajax+php application example of secondary linkage menu without refreshing


Please select a province (autonomous region):








www.bKjia.c0m.php code

$city_arr = array(
"ah"=>"Hefei",
"fj"=>"Fuzhou",
"gs"=>"Lanzhou",
"gd"=>"Guangzhou",
"gx"=>"Nanning",
"gz"=>"Guiyang",
"hn"=>"Haikou",
"hb"=>"Shijiazhuang",
"hh"=>"Zhengzhou",
"hl"=>"Harbin"
);

if(empty($_get['prov']))
{
echo iconv("gb2312","utf-8",'You have not selected a province (autonomous region)');
}
else
{
$prov = $_get['prov'];
$city = $city_arr[$prov];
echo iconv("gb2312","utf-8",'The capital (capital) of the selected province (autonomous region) is:'.$city);
}
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632055.htmlTechArticleThis php ajax application example is a use of ajax+php to call the city's secondary linkage menu, so that we can real-time is updated based on the database content. This php tutorial ajax application example is a...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn