Option field in HTML with PHP

前端 未结 1 1933
广开言路
广开言路 2021-01-28 14:17

I want to search employee list depend on area name which is selected from dropdown list. I can retrieve names of areas from database into dropdown list from PHP HTML. But now I

相关标签:
1条回答
  • 2021-01-28 14:59

    To start, you would have to add a form tag and post the form to another php script.

    Your selected option will be available in either $_POST or $_GET depending on the method used to send the form.

    Example:

    <body>
      <form action="your_second_php_script.php" method="post">
      // your code
      </form>
    </body>
    

    And in your_second_php_script.php:

    <?php
      var_dump($_POST);
    ?>
    

    If you need the results to be available in the original page, you can use ajax to get that working, but I would start with the basics.

    0 讨论(0)
提交回复
热议问题