Home  >  Article  >  Backend Development  >  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

(*-*)浩
(*-*)浩Original
2019-10-15 10:21:086157browse

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>"; 

?>

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>";

?>

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>";
?>

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!

Statement:
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