为什么我无法实现页面的跳转啊?

zbt
Release: 2023-10-25 14:45:52
Original
1240 people have browsed it

echo "<script>alert('欢迎光临');location='pub_main.php';</script>";  
我验证身份信息后应该是跳出一个“欢迎光临”提示窗口,然后跳转到pub_main.php页面啊,为什么我跳转不了呢

回复讨论(解决方案)

前面报错了吧 ? 

加个exit看看

提示正常不能跳转页面么?  
是否路径有问题呢?我试了下,语句没问题的。

这句话没问题啊

查看网页源代码  
估计是没有执行到

echo "<script>alert('欢迎光临');window.location.href='pub_main.php';</script>";  
这样可以跳转。

都是高手高手高高手。

我也会

echo "<script>alert('欢迎光临');window.location.href='pub_main.php';</script>";试试这样,估计可以


echo "<script>alert(&#39;欢迎光临&#39;);location.href=&#39;pub_main.php&#39;;</script>";
Copy after login

楼上的正解了...

Related labels:
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template