Pilpest Posted February 13, 2013 Share Posted February 13, 2013 (edited) So this may seem easy to people who know about PHP more then I, but I've not been able to figure it out even though everyone else is telling me to remove spaces, except IDK where. Heres the error I get- Warning: Cannot modify header information - headers already sent by (output started at *\modules\navbar.php:110) in *\modules\admin.php on line 115. Ignore the * as that is just deleting the extra stuff... Now for the code... Posted in pastebin.com Navbar PHP -------------------------------------------------------- Admin PHP Edited February 13, 2013 by Pilpest Quote Link to comment Share on other sites More sharing options...
enigma# Posted February 13, 2013 Share Posted February 13, 2013 Line 110 in navbar.php you tell it to call HEADER again after you've sent your HTML same with line 115 in admin.php At least that's what I think it is because you closed the PHP and reopened it AFTER the fact with a (HEADER) redirect. If my memory serves, that doesn't fly with PHP. Header cannot be sent AFTER you've sent content/data over. I guess you could use ob_start if it's that important for you to have it that way but I mean you are increasing memory and cpu loads (maybe not that much though xD). Quote Link to comment Share on other sites More sharing options...
Guest The_Monkey Posted February 13, 2013 Share Posted February 13, 2013 Your code worked on my box. Try reversing your if statement so that the first statement is the header change. As Enigma stated, outputting crap outside of php tags can cause the buffer to be sent. As such, you cannot modify the headers. Use ob_start too, again as Enigma suggested. Quote Link to comment Share on other sites More sharing options...
Pilpest Posted February 13, 2013 Author Share Posted February 13, 2013 (edited) Fixed it. Edited February 13, 2013 by Pilpest 1 Quote Link to comment 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.