HOME / BLOG / BLOG-POST

How to redirect a page to another page in php?

Redirect a page to another page in php

function logoutpage(){
 echo '<script LANGUAGE="JavaScript">window.location.href="'.site_url().'/logout/";</script>';
 } 

function dashboard(){
 echo '<script LANGUAGE="JavaScript">window.location.href="'.site_url().'/dashboard/";</script>';
 }

function loginpage(){
 echo '<script LANGUAGE="JavaScript">window.location.href="'.site_url().'";</script>';
 }

//Ex. code used in logouy page  


<?php
/*
Template Name: Logout
*/

session_start();
session_destroy();
session_unset();
loginpage();
?>
<script>
    location.reload();

</script>

 


about authors

Sandip Das

Web Developer

Once a legend said “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” – Martin Fowler.



POST COMMENTS

Leave a Reply

Your email address will not be published. Required fields are marked *