Home  >  Article  >  Backend Development  >  PHP page jump_PHP tutorial

PHP page jump_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:38:56745browse


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 "3f1c4e4b6b16bbbd69b2ee476dc4f83a alert('sucess');parent.location.href='/user/index'; 2cacc6d41bbb37262a98f745aa00fbf0";

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";
echo "<script> alert(&#39;no loginid&#39;); </script>"; 
<em id="__mceDel">echo "<meta http-equiv=&#39;Refresh&#39; content=&#39;0;URL=$url&#39;>";</em>

$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}");

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...
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