FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Problem login out





DanielXP
The login part sets a session

Code:
setcookie("id", $user[id],time()+(60*60*24*5), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*5), "/", "");


But when i use this to delete it

Code:
<style type="text/css"><!--
body, td, th {

}
body {
   background-color: #3495C3
}

}
--></style>

<?
ob_start();
setcookie("id", 2132421,time()+(60*60*24*5), "/", "");
setcookie("pass", loggedout,time()+(60*60*24*5), "/", "");
echo ("You are now logged out!");
?>


i keep getting this error

Warning: Cannot modify header information - headers already sent by (output started at /home/leos4h/public_html/members/logout.php:1) in /home/leos4h/public_html/members/logout.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /home/leos4h/public_html/members/logout.php:1) in /home/leos4h/public_html/members/logout.php on line 15
You are now logged out!
Atomo64
that's because you are starting the output buffer and trying to send the cookies when you already started to send the content, so you have to start a buffer before any output, or, send the cookies before any output (without a buffer).
DanielXP
- Closed -

<?
ob_start();
include("config.php");
?>

Had to be at the very top

Thanks for trying

MOD / Admin please lock
Related topics
DirectAdmin login Problem
login password problem
FTP Login Problem..
PHP login script problem
an annoying problem - PLEASE help
Secure Login on the first page without https://
ftp problem
[RESOLVED] i can't login
Litle Problem
Major Problem with COmputer. Help Please
Dirrect Admin Login Problem
What is the problem 10.12.2005 ?
PHP login/logout problem
PHP Login Problem
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.