Home  >  Article  >  Web Front-end  >  php100中取不到select下拉框中name的值_html/css_WEB-ITnose

php100中取不到select下拉框中name的值_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:07:51968browse

echo $_POST['f_id'];
?>





回复讨论(解决方案)

你这不会是写在一起的吧?这个只有表单提交才行啊。你这里form即没有action的地址,也没有submit的提交按钮,你想让它怎么获取呢?

<form action="test.php" method="post"><select name="f_id"><option value="0">添加大类</option><option value="1">添加小类</option></select><input type = "submit" value = "apply" /></form>


把php代码,写到一个单独的php文件中,我这里是添加到test.php中了,点击apply按钮,就会提交到test.php文件中,是可以获取到值的。
试试吧。

不对,你这应该先找本书,认真看下~~~

Statement:
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