After implementing the PHP pop-up dialog box, we usually need to return the original page or replace the original page with a new page. This article will explain the detailed code writing, for more information, see how many programmers use PHP for WEB development. In this case, functions such as Dialog box pop-up are usually required on the website. The following describes the implementation methods of the PHP pop-up dialog box.
1. PHP pop-up dialog box
<? PHP echo "<script language = \" JavaScript \ "> alert (\" \ "); </script>" ;?> // Or <? PHP print "<script language = \" JavaScript \ "> alert (\" hello \ "); </script>" ;?>
2. if you need a PHP pop-up dialog box and then return to the original page, you can write it like this.
<? PHP echo "<script language = \" JavaScript \ "> \ r \ n"; echo "alert (\" hello \ "); \ r \ n"; echo "history. back (); \ r \ n "; echo" </script> "; exit;?> // Or <? PHP print "<script language = \" JavaScript \ "> \ r \ n"; print "alert (\" hello \ "); \ r \ n"; print "history. back (); \ r \ n "; print" </script> "; exit;?>
3. if the PHP pop-up dialog box is required, replace the original page with a new page (replace the current history). The original page can be written in this way.
<? PHP echo "<script language = \" JavaScript \ "> \ r \ n"; echo "alert (\" hello \ "); \ r \ n"; echo "location. replace (\ "http://www.jb51.net/\"); \ r \ n "; // modify your own URL echo" </script> "; exit;?> Or <? PHP print "<script language = \" JavaScript \ "> \ r \ n"; print "alert (\" hello \ "); \ r \ n"; print "location. replace (\ "http://www.jb51.net/\"); \ r \ n "; // modify your own URL print" </script> "; exit;?>
This article introduces three conditions of the PHP pop-up dialog box, hoping to help you master the implementation of the PHP pop-up dialog box.