This article for you to introduce the use of PHP pop-up prompt box and jump to the new page, which is what you think of the redirect, the following example can be referred to the next two days to write a demo, need to use the prompt and jump, the main page requirements are not high, feel no need to use AJAX,JS, etc. So I studied how to prompt and jump in PHP.
First used the following:
Copy CodeThe code is as follows:
echo "<script> alert (' sucess ');p arent.location.href= '/user/index '; </script> ";
Alert inside is a hint of the message, href is prompted to jump after the page.
Then I thought of a redirect () redirection method in the TP framework and went to see it.
However, the TP comes with not a popup window, so he changed:
Copy CodeThe code is as follows:
echo "<script> alert (' No loginID '); </script> ";
echo "<meta http-equiv= ' Refresh ' content= ' 0; Url= $url ' > ';
$url is the page to jump, at the same time, this can also control the jump time, the content behind the 0 is 0 seconds after the jump.
Here, MO-off gives two direct jump ways:
Copy CodeThe code is as follows:
Header ("Location:".) Psys_base_url. " User/index ");
And
Copy CodeThe code is as follows:
Header ("refresh:{$time};url={$url}");
These two ways without prompting, jump directly. The following one is recommended.
Finally, there is a problem, the jump code followed by a return, because the subsequent statements will be executed
PHP pop-up popup and jump to new page to redirect to New page