Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.