表单值不通过php中的action url传递
我有一个用 PHP 制作的简单表单,我试图传递操作 URL 中提到的页面中的选择值,
<form action="filtertable.php" method="post">
<select class="form-select" name="filtercategory" aria-label="Default select example"
onchange="this.form.submit()">
<option selected>Select Category</option>
<option value="<?php echo $roww["c_id"]; ?>"><?php echo $roww["cname"]; ?></option>
</select>
</form>
当用户在任何选择框中选择时,它将转到页面 filtertable.php,并从那里尝试获取这样的选定值:
<?php
$filtercategory=$_POST['filtercategory'];
但是它不起作用,任何人都可以告诉我这里出了什么问题,提前致谢
I have a simple form made in PHP, I am trying to pass the select value in the page mentioned in the action URL,
<form action="filtertable.php" method="post">
<select class="form-select" name="filtercategory" aria-label="Default select example"
onchange="this.form.submit()">
<option selected>Select Category</option>
<option value="<?php echo $roww["c_id"]; ?>"><?php echo $roww["cname"]; ?></option>
</select>
</form>
when the user selects on any select box it will go to the page filtertable.php, and from there am trying to get the selected value like this:
<?php
$filtercategory=$_POST['filtercategory'];
However it doesn't work, can anyone please tell me what is wrong in here, thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论