当我将隐藏值传递给php文件时,它将(true)1作为答案。无法将隐藏表单值传递给php
我将模态值传递给php文件。
跨度值是使用jquery检索的。
PHP代码:
<?php
include "dbcon.php";
if(isset($_POST['pd_del']))
{
echo mysql_error();
$delid=isset($_POST['delidd']);
echo $delid;
}else
{
echo mysql_error();
}
?>
HTML代码:
形式多数民众赞成派的产品ID到PHP文件
<form name="prd_del" action="del_prod.php" method="post">
<div class="modal fade" id="delModal" tabindex="-1" role="dialog" aria-labelledby="delModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="myModalLabel">DELETE PRODUCT</h4>
</div>
<div class="modal-body">
<h5>Do you want to Delete this Product ??? <span id="delid" name="delid"></span></h5>
<input type="hidden" name="delidd" id="delid">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary" name="pd_del" >Delete It!</button>
</div>
</div>
</div>
</div>
</form>
你有'ID =“delid”'多个元素 – marekful
你没有(价值=“中(<输入型我的价值)=”隐藏的“name =”delidd“id =”delid“>)。你也重复了span中的id() – Tasos
那么我怎样才能将span值传递给php文件 – user3857836