经过多次尝试后,我需要帮助。单击事件后,我检查数据库中存在的数据并使用 jscript 弹出确认框。
当我点击“取消”时,如何让它工作,它没有显示我在confirm.php上设置的任何值?
单击“确定”确认并单击“取消”
j脚本代码:
if($row_count2 > 0)
{
if ($row2["Status"] == "REJECTED")
{
<script type="text/javascript">
if (!confirm('Lot No has been REJECTED before.. Double confirm to add the Lot No!!')) {
var option = "NO";
$.ajax({
type: "POST",
url: "confirm.php",
data: "value="+option,
success: function (data) {
alert(data);
}
});
}
</script>
}
}
$ll = $_SESSION['Confirm'];
echo "<script type='text/javascript'>alert('$ll');</script>";
if ($row_count2 < 1 || ($_SESSION['Confirm'] = "YES"))
{
//my insert query is here...
}
这是在confirm.php里面:
<?php
session_start();
$xx = $_REQUEST["value"];
$_SESSION['Confirm'] = $xx;
echo "<script type='text/javascript'>alert('$xx');</script>";
?>
我期望获得$_SESSION['Confirm']“否”的价值
默认$_SESSION['Confirm']值为 YES
alert(data)$_SESSION['Confirm']显示 $xx 为“否”,但当我在插入查询值之前在 if 条件上设置值警报时,值$_SESSION['Confirm']仍然保持为“是”
芜湖不芜