php+mysql province, city, prefecture level 3 linkage non-refresh menu using ajax technology source code_PHP tutorial

WBOY
Release: 2016-07-13 10:59:11
Original
795 people have browsed it

Very simple

1. First put
Add to header.html page
2. Add the regionss() function to /include/tag.php
3. Create a regions.php file
in the root directory of your website 4. Add {$regionss(People’s Republic of China)} to the appropriate place in your template

Note: The name of the form can be modified according to your needs...


Test page code:



php+ajax dynamically generates drop-down menu




{$regionss(People's Republic of China)}


regionss function code:
//Province, city and prefecture level 3 linkage drop-down menu function regionss province.city.prefecture
function regionss($country="People's Republic of China")
{  
global $db; $i = 1;
$text="";
$text.=" n";
$text.="