Home  >  Article  >  Database  >  PHP pop-up dialog box to implement redirection sample code

PHP pop-up dialog box to implement redirection sample code

怪我咯
怪我咯Original
2017-07-11 16:15:471368browse

First explain, the relationship between page jump and page redirection?

Page redirection must have page jump, page jump does not necessarily have page redirection, that is to say, page redirection is really included in page jump, and page redirection is not sufficient for page jump. Necessary conditions.

Below we introduce several methods to obtain the redirect url:

1 Use js to implement

The code is as follows:

if(!$this->userInfo){ 
$alert_msg = "激活链接错误"; 
echo"<SCRIPT LANGUAGE=&#39;javascript&#39;>alert(&#39;$alert_msg&#39;);window.location=&#39;$redirect_url&#39;;</SCRIPT>"; 
//redirect(base_url()); 
die; 

}

2 php The code to implement

is as follows:

if(!$this->userInfo){ 
$alert_msg = "激活链接错误"; 
echo"<SCRIPT LANGUAGE=&#39;javascript&#39;>alert(&#39;$alert_msg&#39;);</SCRIPT>";//这种方式没有弹窗效果 why? 加上exit 会有弹窗,后续也会重定向; 
redirect(base_url()); 
die; 
}

The above is the detailed content of PHP pop-up dialog box to implement redirection sample code. For more information, please follow other related articles on the PHP Chinese website!

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