Dville Posted July 4, 2006 Share Posted July 4, 2006 So I have put together a membership area into the current script I am coding.After some modding I seem to be getting this error.[code]Warning: Cannot modify header information - headers already sent by. . .[/code]It shows this error for line 171, 172, and 175.I don't remember doing anything to the login page, but i believe it has to do with in if/else syntax issue. Thanks in advanced to anyone that can help.go here to see the page im getting the errors onhttp://phpfi.com/127501 Quote Link to comment https://forums.phpfreaks.com/topic/13661-header-error/ Share on other sites More sharing options...
wildteen88 Posted July 4, 2006 Share Posted July 4, 2006 The reason its doing that is because you are outputted text/html to the browser before you use setcookie and the header functionThese functions cannot be used after there has been output. As they need to send header information to the server, but the header information has already been sent by the text/html.The way to fix this is add ob_start(); after your opening <?php tag and add <?php ob_end_flush(); ?> after your closing html tag, line 213, so your code looks like this:[code=php:0] 1 <?php 2 ob_start();// rest of lines213 </html>214 <?php ob_end_flush(); ?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13661-header-error/#findComment-52978 Share on other sites More sharing options...
Dville Posted July 4, 2006 Author Share Posted July 4, 2006 bad ass, i'd give you a karma point if i knew how, lolim not sure what this function truely does. but i'll try to make some sense of it @php.netthanks again wild Quote Link to comment https://forums.phpfreaks.com/topic/13661-header-error/#findComment-52980 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.