Home > Backend Development > PHP Tutorial > 在一个form表单中,存在多个select,递交到后台文件后,怎么获取到这几个select被选中的值?

在一个form表单中,存在多个select,递交到后台文件后,怎么获取到这几个select被选中的值?

WBOY
Release: 2016-06-13 10:15:04
Original
1198 people have browsed it

在一个form表单中,存在多个select,递交到后台文件后,如何获取到这几个select被选中的值??






在一个form表单中,存在多个select,递交到add.php文件后,如何获取到这两个select被选中的值??

------解决方案--------------------
$_POST['selteaid'];
$_POST['selclaid'];


------解决方案--------------------
form表单中action的参数有用吗?
如果有用:
if(isset($_GET['addTeahcer'])){
echo "下拉菜单1-->>";print_r($_POST['selteaid']);echo "
";
echo "下拉菜单1-->>";print_r($_POST['selclaid']);echo "
";
}
前提是你的前端页面中的下拉菜单有被选择的值:

------解决方案--------------------
不同的select的name属性设置不一样,然后用$_POST就可以获得了
------解决方案--------------------

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template