After implementing the PHP pop-up dialog box, we usually need to return to the original page or replace the original page with a new page. This article will explain the code in detail. For more information, see
After implementing the PHP pop-up dialog box, we usually need to return to the original page or replace the original page with a new page. This article will explain the code in detail. For more information, see
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.
,