Home > Article > Backend Development > PHP popup dialog
This article mainly introduces the PHP pop-up dialog box. Interested friends can refer to it. I hope it will be helpful to everyone.
1. PHP pops up a dialog box
< ?PHP echo "< script language= \"JavaScript\">alert (\"你好\");< /script>"; ?> //或者 < ?PHP print "< script language= \"JavaScript\">alert (\"你好\");< /script>"; ?>
2. If you need PHP to pop up a dialog box and return to the original page, you can write like this
< ?PHP echo "< script language= \"JavaScript\">\r\n"; echo " alert(\"你好\");\r\n"; echo " history.back();\r\n"; echo "< /script>"; exit; ?> //或者 < ?PHP print "< script language= \"JavaScript\">\r\n"; print " alert(\"你好\");\r\n"; print " history.back();\r\n"; print "< /script>"; exit; ?>
3. If you need PHP to pop up a dialog box and replace the original page with a new page (replace the current history record), the original page can be written like this
< ?PHP echo "< script language= \"JavaScript\">\r\n"; echo " alert(\"你好\");\r\n"; echo " location.replace (\"http://www.jb51.net/\"); \r\n"; // 自己修改网址 echo "< /script>"; exit; ?> 或者 < ?PHP print "< script language= \"JavaScript\">\r\n"; print " alert(\"你好\");\r\n"; print " location.replace (\"http://www.jb51.net/\"); \r\n"; // 自己修改网址 print "< /script>"; exit; ?>
Summary: The above is the entire content of this article, I hope it will be helpful to everyone's study.
Related recommendations:
How to obtain the WeChat public account article page
Detailed explanation of PHP variables and string dynamics Inserting variables (case)
The above is the detailed content of PHP popup dialog. For more information, please follow other related articles on the PHP Chinese website!