How to redirect a page in php?

Redirect a page to another one

Team Leader Asked on February 11, 2017 in PHP.
Add Comment
1 Answer(s)

    Using the header function.

     <?php
    /* Redirect browser */
    header("Location: http://www.domain.com/user.php"); 
     exit(); ?>
     

    Using Javascript:

     <?php echo '<script type="text/javascript">
     window.location.href = "http://www.google.com/"
     </script>'; ?>
     
    Team Leader Answered on March 19, 2017.
    Add Comment

    Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.