PHP popup dialog

墨辰丷
Release: 2023-03-30 11:48:01
Original
6116 people have browsed it

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>"; 
?>
Copy after login

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; 
?>
Copy after login

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; 
?>
Copy after login

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)

PHP radix sorting method

The above is the detailed content of PHP popup dialog. 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