Home >Backend Development >PHP Problem >How to jump to the page after successful login in php

How to jump to the page after successful login in php

Guanhui
GuanhuiOriginal
2020-05-09 14:25:2811182browse

How to jump to the page after successful login in php

How to implement successful login page jump in php

First, it will be judged whether the user has successfully logged in. If the login is successful, use "header( )" function, set the "Location" of the http request header to the URL address that needs to be jumped, and then use the function "exit()" to end the script.

header() function

header() is used to send native HTTP headers.

header ( string $string [, bool $replace = true [, int $http_response_code ]] ) : void

Usage examples

<?php
header(&#39;Location: http://www.example.com/&#39;);
exit;
?>

Recommended tutorial: "PHP Tutorial"

The above is the detailed content of How to jump to the page after successful login 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