This article examples for you to share the Ajax combined with PHP to achieve the two-level linkage of the specific code, using AJAX, from PHP to obtain data, specific content as follows
Using AJAX to get data from PHP
Php:
<?php
//For processing client request two-level linkage data
//1. Receive the province information sent by the client
$province = $_post[' provcince '];
2. Determine current province information, provide different city information
switch ($province) {case
' Shandong Province ':
Echo ' Qingdao, Jinan, Weihai, Rizhao, Dezhou ';
break;
Case ' Liaoning Province ':
Echo ' Shenyang, Dalian, Tieling, Dandong, Jinzhou ';
break;
Case ' Jilin Province ':
Echo ' Changchun, Songyuan, Jilin, Tonghua, Siping ';
break;
The server-side response is a string
?>
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.