briansykes Posted June 23, 2008 Share Posted June 23, 2008 I've looked everywhere for hours on end trying to fix this annoying problem i'm getting these warnings: Warning: Cannot modify header information - headers already sent by (output started at /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/session.php:26) in /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/login.php on line 16 Warning: Cannot modify header information - headers already sent by (output started at /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/session.php:26) in /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/login.php on line 17 Warning: Cannot modify header information - headers already sent by (output started at /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/session.php:26) in /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/login.php on line 18 Warning: Cannot modify header information - headers already sent by (output started at /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/session.php:26) in /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/login.php on line 19 I cant fix this i've tried forever everything that forums have said doesnt work the lines of code are the following. setcookie("punch_id", $_SESSION[punch_id], time()+(3600*24*365)); setcookie("punch_nick", $_SESSION[punch_nick], time()+(3600*24*365)); setcookie("punch_pass", $_SESSION[punch_pass], time()+(3600*24*365)); setcookie("punch_rights", $_SESSION[punch_rights], time()+(3600*24*365)); Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/ Share on other sites More sharing options...
.josh Posted June 23, 2008 Share Posted June 23, 2008 searched for hours on end, huh... http://www.phpfreaks.com/forums/index.php/topic,37442.0.html Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572550 Share on other sites More sharing options...
briansykes Posted June 23, 2008 Author Share Posted June 23, 2008 Output buffering doesnt work i tried and removing everything before it would make the script function incorrectly. I've tried both with no success the cookies will not save. There is no html of echo functions in this script its all php and its a login script check password versus db and such. Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572554 Share on other sites More sharing options...
PFMaBiSmAd Posted June 23, 2008 Share Posted June 23, 2008 Start by reading the error messages. They tell you where the output occurred -session.php:26 (line 26) that is preventing your headers from working in login.php on line 16. Warning: Cannot modify header information - headers already sent by (output started at /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/session.php:26) in /mnt/target02/348038/www.harveststudio.ca/web/content/punchclock/login.php on line 16 Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572559 Share on other sites More sharing options...
.josh Posted June 23, 2008 Share Posted June 23, 2008 well obviously there's output somewhere, otherwise you wouldn't be getting those errors. Is the file being included in something else? Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572560 Share on other sites More sharing options...
briansykes Posted June 23, 2008 Author Share Posted June 23, 2008 the file that throws errors is not included in anything its a seperate script i use to check databse password with passwords supplied. Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572583 Share on other sites More sharing options...
.josh Posted June 23, 2008 Share Posted June 23, 2008 Well I don't know what to tell you man, there's only 1 reason you get those errors and that's if there's output somewhere. Can't even have blank lines or spaces. Nothing. You claim there's nothing but there's no other reason you'd be getting those errors. Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572618 Share on other sites More sharing options...
briansykes Posted June 23, 2008 Author Share Posted June 23, 2008 Ok the cookies still wont work, i dont know what the problem is there was whitespace and that is fixed and it still gives these header warnings i changed the cookie names and everything nothing works. Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572626 Share on other sites More sharing options...
DarkWater Posted June 23, 2008 Share Posted June 23, 2008 Make sure there is no whitespace before the opening PHP tag or the ending PHP tag of an included file. Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572639 Share on other sites More sharing options...
briansykes Posted June 23, 2008 Author Share Posted June 23, 2008 Finally i missed a white space in the session script thanks alot for the help guys. Quote Link to comment https://forums.phpfreaks.com/topic/111549-header-problem/#findComment-572672 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.