5 replies
Hi!!
I have just started the programming web development. I face the problem with the header function. The function doesn't redirect. Found this error.

Warning: Cannot modify header information - headers already sent by (output started at /home/kabeet/public_html/flash/page_add.php:4) in /home/public_html/page_add.php on line 72

Please help.
#function #php
  • Profile picture of the author AndyBlackSEO
    This means that you have already outputted to the page before the re-direct was actioned. Somewhere in the code above that line you have echo'd something to the page. Without seeing the code though I wouldn't be able to give you any further info.

    Does the page still re-direct, but displays that message?
    Signature
    [FREE SEO TOOL] Build 29 Effective, High Authority Backlinks that Will Increase Your Google Rankings in 2020... CLICK HERE ...
    ... Instant backlinks that can get you results within 24-72hrs.
    {{ DiscussionBoard.errors[1753799].message }}
  • Profile picture of the author seofan
    As Andy says and the error implies; headers must be sent before any output. Make sure nothing, not even a whitespace is sent before you try to modify header information.
    {{ DiscussionBoard.errors[1753860].message }}
  • Profile picture of the author mywebwork
    Agreed - the header function must be the first line in the code that produces any output.

    That doesn't imply that it must be the first line in the actual code, it can be the 400th line as long as the preceding 399 lines don't actually produce any output.

    Post a sample of the code you're writing so that we can have more details.


    Bill
    {{ DiscussionBoard.errors[1754340].message }}
  • Profile picture of the author Rickmci
    Originally Posted by addymark View Post

    Hi!!
    I have just started the programming web development. I face the problem with the header function. The function doesn't redirect. Found this error.

    Warning: Cannot modify header information - headers already sent by (output started at /home/kabeet/public_html/flash/page_add.php:4) in /home/public_html/page_add.php on line 72

    Please help.

    This error means there has already been sent. check line 72 of the page_add.php function. these error are pretty good ad pointing you to the correct line. the header has to be the first output on the web page. Even a stray char will cause this error.
    Signature

    Visit dotProject Project Management Software for free 60 day Project Management Software.

    {{ DiscussionBoard.errors[1756211].message }}
  • Profile picture of the author Gezawy
    Hi, I found that reply on another forum, and I find it will help:
    On line 72 of the /home/public_html/page_add. php file you have already sent information back to the browser. Most likely via echo or print. Then later in the flow of the program you have tried to use the header function but since the header has already been sent to the browser it can not be modified. So pretty much just what the error says.
    {{ DiscussionBoard.errors[1758507].message }}

Trending Topics