Error in redirecting pages via header

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by ullalax1, Oct 24, 2013.

  1. ullalax1

    ullalax1 New Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    error : headers already sent


    please help me I'm not able to open new page.
     
  2. descalzo

    descalzo Grim Squeaker Community Support

    Messages:
    9,375
    Likes Received:
    327
    Trophy Points:
    83
    Make sure that nothing -- not even whitespace -- is sent by the script before you try to send special headers.

    If a php file has a blank line before the opening <?php tag, then that line is sent and you cannot change/add to the headers.
     
  3. pnk

    pnk New Member

    Messages:
    22
    Likes Received:
    1
    Trophy Points:
    3
    Hi,
    In addition to the answer by Descalzo, You can also try putting <?php @ob_start(); ?> at top of your php file before everything. A complete detail about the function can be found at php.net documentation. Main cause for the error is that you are echoing outputs before the headers statements. Rule is that the headers must not occur after any output created by the script, output may includes spaces and all possible characters.
     

Share This Page