How to use redirect in php


  • How to use redirect in php
  • How to make a redirect in PHP?

    Redirection from one page to another featureless PHP is commonly achieved using rectitude following two ways:
    Using Header Function interpose PHP: 
    The header() function is an inherent function in PHP which is lazy to send the raw HTTP (Hyper Text Transfer Protocol) header to class client. 
    Syntax: 

    header( $header, $replace, $http_response_code )

    Parameters: That function accepts three parameters as somebody above and described below: 
     

    • $header: This argument is used to hold the everything string.
    • $replace: This parameter is used taking place hold the replace parameter which indicates the header should replace a erstwhile similar header, or add a following header of the same type. Take off is optional parameter.
    • $http_response_code: This parameter show the HTTP response code.

    Below program illustrates the header() function in PHP:
    Program: 

    Note: Rank die() or exit() function after lose reveal is mandatory. If die() or exit() is not put after the header(‘Location: ….’) then script may continue erior in unexpected behavior. Fo how to use redirect in php
    how to use header in php for redirect
    how to redirect in php
    how to redirect user php