Jump to content

Redirect Issue


Smee

Recommended Posts

Hey,

 

I am trying to apply a simple redirect script like to a logout page but i understand the redirect needs to be placed in the header before any other php for it to work. Below is the script i am trying to apply.

 

sleep(3);//seconds to wait..
header("Location:http://www.footballtrip.net");

 

The script below is my logout.php with the header and footer of my site added via include scripts, this is where i am finding the problem. After the message you are logged out is it possible to have the script redirect to another by using php?

 

<?php 

// This is the logout for the site

require_once ('./includes/config.inc.php');

$page_title = 'Logout Football Trip';

include ('./includes/header.html');

$_SESSION = array(); // Destroy variables
session_destroy(); // Destroy the session its self
setcookie (session_name(), '', time()-300, '/', '', 0); // Destroy the cookie

?>

    	<div id="content_container">
        	
            <div id="content_header">
            </div>

<?php

echo "<h1>You are now logged out</h1>";

?>

</div>

<?php

include ('./includes/footer.html');

?>

Link to comment
https://forums.phpfreaks.com/topic/203643-redirect-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.