Home  >  Article  >  Backend Development  >  How to implement redirect page jump in php

How to implement redirect page jump in php

王林
王林Original
2020-08-15 14:30:203262browse

How to implement redirection page jump in php: You can use the header() function to redirect. The header() function is used to send raw HTTP headers to the client. The usage method is: [header('location:index.php');].

How to implement redirect page jump in php

#You can use the header() function to redirect.

(Recommended tutorial: php graphic tutorial)

The header() function sends the original HTTP header to the client.

Syntax:

header(string,replace,http_response_code)

Parameters:

  • ##string Required. Specifies the header string to be sent.

  • #replace Optional. Indicates whether this header replaces the previous header, or adds a second header. Default is true (replacement). false (allow multiple headers of the same type).

  • http_response_code Optional. Forces the HTTP response code to the specified value. (Available for PHP 4 and above)

(Recommended video tutorial:

php video tutorial)

Implementation code:

<?php
header(&#39;content-type:text/html;charset=uft-8);
//重定向页面
header(&#39;location:index.php&#39;);
?>

The above is the detailed content of How to implement redirect page 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