calmchess Posted March 21, 2009 Share Posted March 21, 2009 First of all I know the header rules about white space and sending it before any output....I don't have a problem makeing my header redirect work as long as 1 unusual condition is met that condition being too many CSS styles embeded in the webpage if i remove half of the CSS styles in any random order then my header redirect works but if i leave all the CSS styles then the header redirect gives me the old headers have already been sent error......does anyone other than me think this maybe a php bug???Has anybody ever had this problem I can't google anything about it. Link to comment https://forums.phpfreaks.com/topic/150504-header-error-worth-looking-at/ Share on other sites More sharing options...
WolfRage Posted March 21, 2009 Share Posted March 21, 2009 Let's see the code, because the number of style sheets does not matter at all. Why you ask, because nothing can be sent before the headers like you said, and that includes stylesheets. So I am still very convinced that there must be an error in your code. I am not trying to offend, but lets see it just to prove it either way. Link to comment https://forums.phpfreaks.com/topic/150504-header-error-worth-looking-at/#findComment-790500 Share on other sites More sharing options...
PFMaBiSmAd Posted March 21, 2009 Share Posted March 21, 2009 The error message indicates where the output is occurring that is preventing the headers from working. It would take seeing the error message and the code responsible for the output. One likely possibility is that output buffering is being used but that your amount of content being output before the header exceeds the buffer size and it is being automatically flushed to the browser. What does a phpinfo() statement show for output_buffering? Link to comment https://forums.phpfreaks.com/topic/150504-header-error-worth-looking-at/#findComment-790502 Share on other sites More sharing options...
calmchess Posted March 21, 2009 Author Share Posted March 21, 2009 output buffering is 4096. Link to comment https://forums.phpfreaks.com/topic/150504-header-error-worth-looking-at/#findComment-790509 Share on other sites More sharing options...
calmchess Posted March 21, 2009 Author Share Posted March 21, 2009 i changed the output buffering to 5069 and poof all my problems disappeared...thanks for helping me out ...i keep learning about this coding stuff someday i'll be an expert. Link to comment https://forums.phpfreaks.com/topic/150504-header-error-worth-looking-at/#findComment-790518 Share on other sites More sharing options...
Mchl Posted March 21, 2009 Share Posted March 21, 2009 It does not disappear... it's just postponed... for another kilobyte worth of output. Link to comment https://forums.phpfreaks.com/topic/150504-header-error-worth-looking-at/#findComment-790521 Share on other sites More sharing options...
PFMaBiSmAd Posted March 21, 2009 Share Posted March 21, 2009 output buffering is one of the stupid things that was added to php to allow incorrectly written code to function. It does not fix the problem. First of all I know the header rules about white space and sending it before any output.... If you in fact know the rules about content and headers, why does your code send content before a header and only just barely work because output buffering is turned on in your php.ini? Your code may currently function, but when you put it onto a different server where you don't have the ability to set the output buffer size, you will be back at the same point, with code that does not work and needs to be fixed. It is always best to write code that is correct so that it will work under all conditions. The content/header restriction is not going away because it is fundamental to how the http protocol works. Link to comment https://forums.phpfreaks.com/topic/150504-header-error-worth-looking-at/#findComment-790531 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.