详细解读PHP弹出对话框技巧_PHP教程
程序员文章站
2022-05-26 20:53:46
...
许多程序员们运用
1. PHP弹出对话框
- ?PHP
-
echo "script language=
"JavaScript">alert
("你好");script>"; - ?>
或者
- ?PHP
-
print "script language=
"JavaScript">alert
("你好");script>"; - ?>
2. 如果需要PHP弹出对话框之后返回原来页面可以这么写
- ?PHP
- echo "script language=
"JavaScript">rn";- echo " alert("你好");rn";
- echo " history.back();rn";
- echo "script>";
- exit;
- ?>
或者
- ?PHP
- print "script language=
"JavaScript">rn";- print " alert("你好");rn";
- print " history.back();rn";
- print "script>";
- exit;
- ?>
3. 如果需要PHP弹出对话框之后用新的页面替换原来的页面(更换当前历史纪录),原来页面可以这么写
- ?PHP
- echo "script language=
"JavaScript">rn";- echo " alert("你好");rn";
- echo " location.replace
("http://www.asm32.net/");
rn"; // 自己修改网址- echo "script>";
- exit;
- ?>
或者
- ?PHP
- print "script language=
"JavaScript">rn";- print " alert("你好");rn";
- print " location.replace
("http://www.asm32.net/");
rn"; // 自己修改网址- print "script>";
- exit;
- ?>