双选确认框,点击是跳转到yes.html,点击否跳转到no.html (推荐学习:PHP视频教程)
<?php echo "<script> if(confirm( '请选择跳转页面,是跳转到yes.html 否跳转到no.html? ')) location.href='yes.html';else location.href='no.html'; </script>"; ?>
双选确认框,选择后继续弹出确认对话框
<?php echo "<script> var sure=confirm( '确认你的操作吗 '); if (1==sure){alert( '你选择了是 ')} else {alert( '你选择了否 ');}</script>"; ?>
弹出确认框,点击确定跳转到目标页面
<?php echo "<script> {window.alert('发布成功');location.href='aa.html'} </script>"; ?>
以上就是php怎么点击按钮弹出确认框的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号