Php+javascript using Php+javascript to achieve level two cascading menu production

Source: Internet
Author: User
The general idea is this: in order not to let the previous page refresh, I used an IFRAME to sneak into a two-level sub-page, to read the data in the database, and finally pass the desired data to the parent page, complete the selection and transfer of data.
The main program code is as follows (some code changes, but does not affect functionality):
Parent page reg.html:

Sub-page city.php:

Please select your province include_once ("db.php"), $sql = "SELECT * from Province order by sh_id ASC"; $result =mysql_query ($sql); ROW=MYSQL_FETCH_ASSOC ($result)) {?>" > }?>
Select your city if (!empty ($_get["sh_id")) {//echo "OK", $sql = "SELECT * from city where sh_id=". $_get["sh_id"]. "ORDER by CI ty_id ASC "; $result =mysql_query ($sql); while ($row =mysql_fetch_assoc ($result)) {?>"> }?>

The above describes the Php+javascript with the php+javascript to achieve two-level cascading menu production, including the php+javascript aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.