Home  >  Article  >  Backend Development  >  What are the methods to implement URL jump in php?

What are the methods to implement URL jump in php?

王林
王林Original
2020-11-03 14:35:215359browse

The methods for php to implement URL jump are: 1. Use the header function to implement the jump, such as [header('location:index.php');]; 2. Use the meta tag in the HTML header to implement the jump. Transfer; 3. Use javascript to realize the jump.

What are the methods to implement URL jump in php?

The methods are as follows:

First method: Use the header() function to redirect.

(Recommended tutorial: php video tutorial)

Note: There cannot be a space between locationhe and ":".

Second: Use the meta tag in the HTML header to define http-equiv=refresh and content=”The time it takes to jump (in seconds); url=jump address”




    
    //跳转页面,跳转时间:3秒钟,目标地址:index.php
    
    skip...

or


 


    
    //跳转页面,跳转时间:2秒钟,目标地址:index.php
    
    skip...

The third type: use javascript to jump

window.location.href='$url';;
?>

Related recommendations: php training

The above is the detailed content of What are the methods to implement URL jump in php?. For more information, please follow other related articles on the PHP Chinese website!

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