Note: 1. There must be no space between location and :, otherwise there will be no jump. 2. There cannot be any input before header()"/> Note: 1. There must be no space between location and :, otherwise there will be no jump. 2. There cannot be any input before header()">

Home >Backend Development >PHP Tutorial >Various interface jump methods in php_PHP tutorial

Various interface jump methods in php_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 10:32:22974browse

Method 1: header() function in PHP

<ol class="linenums"><li class="L0" value="1"><?php<li class="L1">header("Location:http://blog.phpha.com");<li class="L2">?>

Note:
1. There cannot be a space between location and :, otherwise it will not jump.
2. There cannot be any output before header().
3. The PHP code after header() will also be executed.

Method 2: Meta tag
The Meta tag is a tag in HTML that is responsible for providing document meta-information. Using this tag in a PHP program can also achieve page jumps. If http-equiv is defined as refresh, when the page is opened, it will jump to the corresponding page within a certain period of time based on the value specified by content. If content="seconds;url=website" is set, it defines how long it will take for the page to jump to the specified URL.

<ol class="linenums"><li class="L0" value="1"><html><li class="L1"><head><li class="L2"><meta http-equiv="refresh" content="1;url=http://blog.phpha.com"><li class="L3"><title>HTML标题</title><li class="L4"></head><li class="L5"><content><li class="L6">天涯PHP博客欢迎大家光临!<li class="L7"></content><li class="L8"></html>

Method 3: javascript implementation

<ol class="linenums"><li class="L0" value="1"><script language="javascript" type="text/javascript"><li class="L1">location.href = "http://blog.phpha.com";<li class="L2"></script>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/755787.htmlTechArticleMethod 1: header() function in PHP header("Location:http://blog.phpha.com" ); ?> Note: 1. There cannot be any space between location and:, otherwise the jump will not occur. 2. There cannot be any input before header()...
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