Home > php教程 > php手册 > body text

PHP弹出提示框并跳转到新页面(重定向)

WBOY
Release: 2016-06-13 09:43:54
Original
809 people have browsed it

开始使用如下跳转:
echo "<script> alert('sucess');parent.location.href='/user/index'; </script>";

alert里面是提示的消息,href是提示后跳转的页面。

后来想起TP框架里面有个redirect()重定向的方法,就去看了看。

不过TP自带的不是弹出窗,于是修改为:

<span $url="http://www.jbxue.com";</span>
Copy after login
<span echo</span> "<script> alert('no loginid'); </script>"<span>; </span>
Copy after login
<em id="__mceDel"><span echo</span> "<meta http-equiv='Refresh' content='0;URL=<span $url</span>'>";</em>
Copy after login

两个直接跳转的方式:

<span header</span>("Location:".PSYS_BASE_URL."user/index"<span ); 
和 
</span><span header</span>("refresh:{<span $time</span>};url={<span $url</span>}");
Copy after login

最后还有一个问题,跳转代码后都跟上一个 return,因为还会执行后面的语句。

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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template