Home  >  Article  >  php教程  >  PHP弹出提示框并跳转到新页面(重定向)

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

WBOY
WBOYOriginal
2016-06-13 09:43:54806browse

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

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

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

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

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

两个直接跳转的方式:

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

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

Statement:
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