Javascript PHP-未检测到isset($#u POST[';rejectSeed';])
不符合此代码。我有一个模式,其中有一个提交按钮,每次我必须单击提交按钮时,都没有任何操作或类似操作将其插入数据库。我在同一个文件中有相同的代码,具有相同的功能,但另一个可以工作。因此,数据库插入不是问题所在Javascript PHP-未检测到isset($#u POST[';rejectSeed';]),javascript,php,jquery,Javascript,Php,Jquery,不符合此代码。我有一个模式,其中有一个提交按钮,每次我必须单击提交按钮时,都没有任何操作或类似操作将其插入数据库。我在同一个文件中有相同的代码,具有相同的功能,但另一个可以工作。因此,数据库插入不是问题所在 //REJECTED PROJECT & CHECKING FOR REASON if(isset($_POST['rejectSeed'])){ echo "HUY"; $query3="UPDATE projects SET p
//REJECTED PROJECT & CHECKING FOR REASON
if(isset($_POST['rejectSeed'])){
echo "HUY";
$query3="UPDATE projects
SET project_status = '7', reason = '".$_POST['reasonSeed']."'
WHERE id =".$idProj."";
retrieveTable($query3);
header('Location: listprojectsprojectproposal.php');
}
echo”
&时代;
拒绝“$strings[“project”]”:“$projectDetail->pro_name[0]”
请说明种子公司拒绝该项目的原因“$projectDetail->pro_name[0]”(例如,不足)
拒绝理由:
";
您必须在模型中添加表单标记
<form action="" method="post">
<div class='modal fade' id='modalRejectSeed' role='dialog'>
<div class='modal-dialog modal-lg'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'>×</button>
<h4 class='modal-title'>Reject ".$strings["project"].": ".$projectDetail->pro_name[0]."</h4>
</div>
<div class='modal-body'>
<h5>Please state the reason why Seed Company rejected the project ".$projectDetail->pro_name[0].". (eg. Insufficient)</h5>
<div class='input-group'>
<span class='input-group-addon' id='basic-addon1' style='width:500px;'>Reason for Rejection:</span>
<input type='text' id='reasonSeed' name='reasonSeed' class='form-control' style='width:500px;' placeholder='' aria-describedby='basic-addon1'>
</div>
</div>
<div class='modal-footer'>
<input type='submit' id='rejectSeed' class='btn btn-primary' name='rejectSeed'>
</div>
</div>
</div>
</div>
</form>
&时代;
拒绝“$strings[“project”]”:“$projectDetail->pro_name[0]”
请说明种子公司拒绝该项目的原因“$projectDetail->pro_name[0]”。(例如,不足)
拒绝理由:
您正面临大规模XSS和SQL注入攻击。您需要将数据转义到HTML并使用参数化SQL查询。如果您尝试var\u dump($\u POST)
,您将看到'rejectSeed'
不存在。哦,显然这段代码中没有任何内容在
中,那么你提交的是什么?@xorifhi,方法$\u POST与我在下面写的代码位于同一个文件中。我还需要把它放在表格里吗?我不知道提交时需要表格。你的回答真的很有帮助。
<form action="" method="post">
<div class='modal fade' id='modalRejectSeed' role='dialog'>
<div class='modal-dialog modal-lg'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'>×</button>
<h4 class='modal-title'>Reject ".$strings["project"].": ".$projectDetail->pro_name[0]."</h4>
</div>
<div class='modal-body'>
<h5>Please state the reason why Seed Company rejected the project ".$projectDetail->pro_name[0].". (eg. Insufficient)</h5>
<div class='input-group'>
<span class='input-group-addon' id='basic-addon1' style='width:500px;'>Reason for Rejection:</span>
<input type='text' id='reasonSeed' name='reasonSeed' class='form-control' style='width:500px;' placeholder='' aria-describedby='basic-addon1'>
</div>
</div>
<div class='modal-footer'>
<input type='submit' id='rejectSeed' class='btn btn-primary' name='rejectSeed'>
</div>
</div>
</div>
</div>
</form>