Please help me with this error

Discussion in 'PHP' started by minhazikram, Jan 24, 2012.

  1. #1
    Warning: Cannot modify header information - headers already sent by (output started at /home/content/77/8866377/html/gsmarenabd/insert_model.php:25) in/home/content/77/8866377/html/gsmarenabd/insert_model.php on line 105

    this occurs when i add a header redirect in my script.

    what does the line insert_model.php:25 means. and what is the solution of this error please can anyone tell me.
     
    minhazikram, Jan 24, 2012 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    It means there is output to the browser before your redirect. You can have logic and php code, but you cannot output anything to the browser before a redirect.
     
    jestep, Jan 24, 2012 IP
  3. hallianonline

    hallianonline Active Member

    Messages:
    104
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    try placing this at the top of your page:
    <? ob_start(); ?>

    then at the bottom of the page place this line of code:

    <? ob_flush(); ?>
     
    hallianonline, Jan 24, 2012 IP
  4. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #4
    this only means that there's some text that is already echoed or printed even before you call header();

    if not, check for spaces before <?php..
     
    JohnnySchultz, Jan 25, 2012 IP