shebbycs Posted November 29, 2011 Share Posted November 29, 2011 <?php session_start(); $_SESSION['is_logged_out'] = 1; if($_SESSION['is_logged_out'] ==1) { echo("<SCRIPT LANGUAGE='JavaScript'>window.alert('You had been successfully signed out')</SCRIPT>"); session_unset(); session_destroy(); header("Location:chatframe.php"); } ?> I got this error Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\login\logout.php:6) in C:\xampp\htdocs\login\logout.php on line 9 which mistake im put? Quote Link to comment https://forums.phpfreaks.com/topic/252011-php-logout/ Share on other sites More sharing options...
MasterACE14 Posted November 29, 2011 Share Posted November 29, 2011 you can't have any output before the header() function. So in your case you can't have that echo() in there. Quote Link to comment https://forums.phpfreaks.com/topic/252011-php-logout/#findComment-1292065 Share on other sites More sharing options...
Spring Posted November 29, 2011 Share Posted November 29, 2011 echo '<meta http-equiv="refresh" content="0;url=YOURURL">'; you can use that as an alternative if you want. Quote Link to comment https://forums.phpfreaks.com/topic/252011-php-logout/#findComment-1292066 Share on other sites More sharing options...
shebbycs Posted November 29, 2011 Author Share Posted November 29, 2011 you can't have any output before the header() function. So in your case you can't have that echo() in there. thanks now im had clear my doubts Quote Link to comment https://forums.phpfreaks.com/topic/252011-php-logout/#findComment-1292074 Share on other sites More sharing options...
shebbycs Posted November 29, 2011 Author Share Posted November 29, 2011 echo '<meta http-equiv="refresh" content="0;url=YOURURL">'; you can use that as an alternative if you want. ya it is better alternative Quote Link to comment https://forums.phpfreaks.com/topic/252011-php-logout/#findComment-1292075 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.