PHP page jump_PHP tutorial

WBOY
Release: 2016-07-13 10:38:56
Original
744 people have browsed it


A very simple demo that needs to implement prompts and jumps. The main page requirements are not high, and I feel there is no need to use AJAX, JS, etc.

So I studied the PHP prompt and jumped.

Start using the following jump:
echo "<script> alert('sucess');parent.location.href='/user/index'; </script>";

The alert contains the prompt message, and the href is the page to jump to after the prompt.

Later, I remembered that there is a redirect() redirection method in the TP framework, so I went to check it out.

However, TP does not come with a pop-up window, so it was modified to:

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

$url is the page to be jumped. At the same time, this can also control the jump time. The 0 after content means that the page will jump after 0 seconds.

Two direct jump methods:

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

These two methods will jump directly without prompt. The following one is recommended.

Finally, there is another problem. The jump code is always followed by a return, because the following statements will also be executed.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/735046.htmlTechArticleA very simple demo that needs to implement prompts and jumps. The main page requirements are not high. I feel there is no need to use AJAX. , JS, etc. So I studied the PHP prompt and jumped. Get started like...
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!