Double-select confirmation box, click yes to jump to yes.html, click no to jump to no.html (recommended learning: PHP video tutorial )
<?php echo "<script> if(confirm( '请选择跳转页面,是跳转到yes.html 否跳转到no.html? ')) location.href='yes.html';else location.href='no.html'; </script>"; ?>
Double-select the confirmation box, and the confirmation dialog box will continue to pop up after selection
<?php echo "<script> var sure=confirm( '确认你的操作吗 '); if (1==sure){alert( '你选择了是 ')} else {alert( '你选择了否 ');}</script>"; ?>
The confirmation box will pop up, click OK to jump to the target page
<?php echo "<script> {window.alert('发布成功');location.href='aa.html'} </script>"; ?>
The above is the detailed content of How to click a button to pop up a confirmation box in php. For more information, please follow other related articles on the PHP Chinese website!