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 movidalatina, Feb 26, 2010.

Thread Status:
Not open for further replies.
  1. #1
    If anyone can show me the light I'll appreciate it. I have a
    Wordpress blog and http://www.myblogsite.com only shows this
    warning message:
    Warning: Cannot modify header information - headers
    already sent by (output started at /home/howtoma/public_html/wp-content/themes/newstheme/functions.php:139)
    in /home/howtoma/public_html/wp-includes/pluggable.php on line 865


    But if I just go to http://myblogsite.com (without www) it shows up perfect

    what do you suppose is going on?

    Thanks
     
    movidalatina, Feb 26, 2010 IP
  2. CoreyPeerFly

    CoreyPeerFly Notable Member Affiliate Manager

    Messages:
    394
    Likes Received:
    24
    Best Answers:
    5
    Trophy Points:
    240
    #2
    Both of those links work fine for me. No errors appear. Did you fix it?
     
    CoreyPeerFly, Feb 26, 2010 IP
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #3
    You've probably already found it but just look for a blank line at the end of functions.php

    A single space after the ?> will send the space out to the browser and then the headers can't be sent.
     
    sarahk, Feb 26, 2010 IP
  4. HuggyStudios

    HuggyStudios Well-Known Member

    Messages:
    724
    Likes Received:
    20
    Best Answers:
    26
    Trophy Points:
    165
    #4
    Add

    
    ob_start();
    
    PHP:
    At the very top of the scripting, must be the very first command then you will not have any problems.
     
    HuggyStudios, Feb 27, 2010 IP
  5. movidalatina

    movidalatina Well-Known Member

    Messages:
    1,268
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    105
    #5
    Thanks sarahk, but I have not found it. and even still haven't found it.....lol
    thanks anyway
     
    movidalatina, Feb 27, 2010 IP
  6. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #6
    Follow what Hughesy suggested.

    Add:

    ob_start();
    PHP:
    right at the top of the file, and add:

    ob_end_flush();
    PHP:
    right at the bottom of the file (ensuring you its within php tags).
     
    danx10, Feb 27, 2010 IP
  7. movidalatina

    movidalatina Well-Known Member

    Messages:
    1,268
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    105
    #7

    yeah thanks danx10, but no luck with those
     
    movidalatina, Feb 27, 2010 IP
  8. Om ji Kesharwani

    Om ji Kesharwani Peon

    Messages:
    211
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    blank space passed before geting session variable
     
    Om ji Kesharwani, Feb 28, 2010 IP
  9. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #9
    Don't do that unless you have a specific reason to need it. Far better to identify the actual problem before you add work arounds to your code.

    Basically you need to find what is sending something to the browser before you send the headers (cookies, redirects, data type info etc) and it might be a line of code (can you move it down past your header lines) or a space after the ?>

    If it's a easily fixed you don't want the overheads both in processing and future maintenance of ob code.
     
    sarahk, Feb 28, 2010 IP
    movidalatina likes this.
  10. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #10
    I agree, that its better to identify the actual problem, but following:

    I thought I'd suggest an easier solution...

    But if this hasnt been resolved, can the OP post the contents of functions.php here, please.
     
    danx10, Feb 28, 2010 IP
    movidalatina likes this.
  11. movidalatina

    movidalatina Well-Known Member

    Messages:
    1,268
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    105
    #11
    thanks fellas greens for the help..
     
    movidalatina, Feb 28, 2010 IP
Thread Status:
Not open for further replies.