Home > Backend Development > PHP Problem > How to click a button to pop up a confirmation box in php

How to click a button to pop up a confirmation box in php

(*-*)浩
Release: 2023-02-26 17:22:01
Original
6218 people have browsed it

How to click a button to pop up a confirmation box in php

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( &#39;请选择跳转页面,是跳转到yes.html  否跳转到no.html? &#39;))  location.href=&#39;yes.html&#39;;else location.href=&#39;no.html&#39;; </script>"; 

?>
Copy after login

Double-select the confirmation box, and the confirmation dialog box will continue to pop up after selection

<?php

echo "<script> var sure=confirm( &#39;确认你的操作吗 &#39;); if (1==sure){alert( &#39;你选择了是 &#39;)} else {alert( &#39;你选择了否 &#39;);}</script>";

?>
Copy after login

The confirmation box will pop up, click OK to jump to the target page

<?php 
echo "<script> {window.alert(&#39;发布成功&#39;);location.href=&#39;aa.html&#39;} </script>";
?>
Copy after login

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!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template