1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Warning: Cannot modify header information

Discussion in 'PHP' started by kiwigurlnz, Sep 16, 2011.

  1. #1
    When I submit an image this is the error that shows up.

    Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/mydomain.com/httpdocs/template/header.tpl.php:6) in /var/www/vhosts/mydomain.com/httpdocs/suggest.php on line 140
    Code (markup):
    Although this error is showing, when I check to see if it was submitted in the backend of my site, it has. So submitting an image works but have know idea how to fix that error above.

    Any help appreciated, thanks.
     
    kiwigurlnz, Sep 16, 2011 IP
  2. HuggyEssex

    HuggyEssex Member

    Messages:
    297
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    45
    #2
    Place at the very beginning of your site the first piece of code to run, this must be the very first line!

    
    ob_start();
    
    PHP:
    That will be your problem fixed :)

    Glen
     
    HuggyEssex, Sep 16, 2011 IP
  3. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #3
    check suggest.php, you might have a string echoed or html displayed above line 140.

    maybe you can post suggest.php here? so i can tell you which part exactly caused the error..
     
    JohnnySchultz, Sep 16, 2011 IP
  4. KISS

    KISS Active Member

    Messages:
    135
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    I usually get this when I try to change header information after I have echoed something in php.
     
    KISS, Sep 16, 2011 IP
  5. kiwigurlnz

    kiwigurlnz Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Thanks, this worked and thanks to everyone else who also posted. :)
     
    kiwigurlnz, Sep 16, 2011 IP