设想:
我有一个confirmation pop up message
地方,当我单击OK
按钮时,它将继续或保存我创建的条目-这没关系..但是当我单击CANCEL
按钮时,它将返回到页面booking_content.php
-这个没关系...
问题:
现在的问题是CANCEL
,返回页面很好,但its still saving the entry which is when I pressed the
取消it will not save and will return back to the page of
booking_content.PHP`。
问题:
有没有办法*terminate the program*
当我点击CANCEL
?我也试过了,EXIT;
但它不起作用....
这是我的 Javascript 和 PHP 代码:
// other if else..
else if($network == "Mass and Mobile" && $row[fldTotalDuration] == "08:00:00" && $duration >= "0 s")
{?><?php
if(sizeof($bldg) == 1)
{
echo "<script type='text/javascript'>\n";
echo "alert('$bldg[$i] station is already full.');\n";
echo "window.location='booking_content.php'";
echo "</script>";
}
else
{ ?>
<script>
var r=confirm('$bldg[$i] station is already full. Do you want to save the other networks?')
if (r==true) {
alert("OKAY BUTTON");
} else {
window.location='booking_content.php';
}
</script>
<?php
}
}
//after all the if else...
else
{
// heres my code for saving the data....
}
先感谢您...