Home  >  Article  >  Backend Development  >  Divine operation to realize PHP jump

Divine operation to realize PHP jump

花姐姐
花姐姐forward
2020-05-06 10:18:552394browse

Divine operation to realize PHP jump

There are several ways to implement page jump in PHP

Achieved in PHP script code

## b2fef6c590d42b44815f93a4589b0b94

For example 85b819a23608d0acc96e6ba6eafbf5dd The page will jump immediately because The header performs location redirection


Delayed jump (For example, after successful login, there will be a few seconds of waiting time, and then it jumps to other pages)

62196d8a993911ad551cde268c5e75ed

For example22e0c2b7b3ab301288ce446b28a3d6aa The jump will be executed after 3 seconds

f2ebce98b292e285de12527c217324f3 The sleep() method is called, and the effect is that the jump will be executed after x seconds Transfer

Implement in js script code

1.window.location.href method

<script type="text/javascript">
  window.location.href="helloworld.php"          
</script>

Use js method to implement delayed jump

<script type="text/javascript">  
    setTimeout("window.location.href=&#39;helloworld.php&#39;",3000);
</script>

2.window.location.assign method Delayed jump method is the same as above

<script type="text/javascript">
    window.location.assign("helloworld.php");
</script>

3.window.location.replace method (let the new page replace the current page, it will not be saved in the history, all You cannot use the browser to return to the original page)

<script type="text/javascript">
  window.location.replace("helloworld.php");
</script>

4. The window.open method has three parameters, the first URL address. The second is the way to open a new page (such as new page _blank, _new, self jump _self), and the third is the way to open a new page, including style, location, etc.

<script type="text/javascript">  
    window.open("index.php",_blank,width=300px);
</script>

Use HTML script code to complete the jump

Execute the code in the 93f0f5c25f18dab9d176bd4f6de5d30e tag

Insert this code directly You can

<meta http-equiv="refresh" content="3;url=&#39;helloworld.php&#39;">

achieve relevant jumps in a fancy way, you deserve it

Recommended learning:

PHP

The above is the detailed content of Divine operation to realize PHP jump. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete
Previous article:Basic use of PHP SwooleNext article:Basic use of PHP Swoole