In a simple demo, You need to implement prompts and jump. The main page does not have high requirements and you do not need to use AJAX or JS.
So I learned how to prompt and jump in PHP.
Start using the following jump:
Echo "<script> alert ('sucess '); parent. location. href ='/user/Index'; </script> ";
Alert contains the prompt message and href is the page to jump to after the prompt.
Later I remembered that there was a redirect () redirection method in the TP framework, so I went and looked at it.
However, TP does not bring a pop-up window, so it is changed:
$ Url = "http://www.jbxue.com ";
Echo "<script> alert ('no loginid'); </script> ";
Echo "<meta http-equiv = 'refresh' content = '0; URL = $ url'> ";
$ Url is the page to jump to. At the same time, this can also control the jump time. The value 0 after content indicates that the page will jump after 0 seconds.
Two direct jump methods:
Header ("Location:". PSYS_BASE_URL. "user/index"); and header ("refresh: {$ time}; url = {$ url }");
There are no prompts for these two methods, so you can jump directly. The following is recommended.
Finally, there is another problem. After the jump code is followed by a return, because the subsequent statements will be executed.