Home > Backend Development > PHP Tutorial > Detailed interpretation of PHP pop-up dialog box techniques_php techniques

Detailed interpretation of PHP pop-up dialog box techniques_php techniques

WBOY
Release: 2016-05-16 20:07:12
Original
1023 people have browsed it

Many programmers use PHP language for WEB development. Then in websites, you usually encounter functional requirements such as dialog box pop-ups. Below we will introduce in detail the relevant implementation methods of PHP pop-up dialog boxes.
1. PHP pop-up dialog box

< &#63;PHP 
echo "< script language=
\"JavaScript\">alert
(\"你好\");< /script>"; 
&#63;> 
//或者
< &#63;PHP 
print "< script language=
\"JavaScript\">alert
(\"你好\");< /script>"; 
&#63;> 
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

< &#63;PHP 
echo "< script language=
\"JavaScript\">\r\n"; 
echo " alert(\"你好\");\r\n"; 
echo " history.back();\r\n"; 
echo "< /script>"; 
exit; 
&#63;> 
//或者
< &#63;PHP 
print "< script language=
\"JavaScript\">\r\n"; 
print " alert(\"你好\");\r\n"; 
print " history.back();\r\n"; 
print "< /script>"; 
exit; 
&#63;> 
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

< &#63;PHP 
echo "< script language=
\"JavaScript\">\r\n"; 
echo " alert(\"你好\");\r\n"; 
echo " location.replace
(\"http://www.jb51.net/\");
\r\n"; // 自己修改网址 
echo "< /script>"; 
exit; 
&#63;> 
或者

< &#63;PHP 
print "< script language=
\"JavaScript\">\r\n"; 
print " alert(\"你好\");\r\n"; 
print " location.replace
(\"http://www.jb51.net/\");
\r\n"; // 自己修改网址 
print "< /script>"; 
exit; 
&#63;> 
Copy after login

This article introduces three situations of PHP pop-up dialog boxes, hoping to help everyone master the implementation method of PHP pop-up dialog boxes.

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