Smee Posted June 2, 2010 Share Posted June 2, 2010 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'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/203643-redirect-issue/ Share on other sites More sharing options...
ram4nd Posted June 2, 2010 Share Posted June 2, 2010 just remove the sleep, put it to top of the page. can't echo if redirect, no point. sleep is server side you do know that? Quote Link to comment https://forums.phpfreaks.com/topic/203643-redirect-issue/#findComment-1066744 Share on other sites More sharing options...
Smee Posted June 2, 2010 Author Share Posted June 2, 2010 No i didn't i will give it a go, Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/203643-redirect-issue/#findComment-1066750 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.