PHP中的确认框

时间:2015-10-18 11:00:46

标签: javascript php jquery confirmation

我在if子句中按下提交按钮后尝试弹出确认框。如果单击“确定”,PHP脚本将继续执行,如果单击“取消”,则会停止。

if(isset($_POST['submit'])) {
   $get_randeman = $_POST['randeman_realize'];
   if($get_randeman < $randeman_min) {
      echo '<script>confirm("Are you sure?");
          if(confirm("Are you sure?") == false) {
             return;
          } else {
          continue;
         }
   </script>';
} else {

//proceed

1 个答案:

答案 0 :(得分:0)

你需要这样的东西:

<a href="http://www.google.com" onclick='
            if(confirm("Are you sure?") == false) {
                return false;
            } else {
                //
            }'>google.com</a>
相关问题