WordPress.org

Ready to get started?Download WordPress

Forums

comments error (10 posts)

  1. danithew
    Member
    Posted 10 years ago #

    It appears the error message I'm getting involves two different files and I'm not sure which one I should edit. Any idea?
    After a visitor types up a comment and clicks: "Say it!", this is what they see:
    Warning: Cannot modify header information - headers already sent by (output started at /home/wumpc14/public_html/wumpblog/wp-content/plugins/wp-last-visit.php:282) in /home/wumpc14/public_html/wumpblog/wp-comments-post.php on line 89
    Warning: Cannot modify header information - headers already sent by (output started at /home/wumpc14/public_html/wumpblog/wp-content/plugins/wp-last-visit.php:282) in /home/wumpc14/public_html/wumpblog/wp-comments-post.php on line 90
    Warning: Cannot modify header information - headers already sent by (output started at /home/wumpc14/public_html/wumpblog/wp-content/plugins/wp-last-visit.php:282) in /home/wumpc14/public_html/wumpblog/wp-comments-post.php on line 91
    Warning: Cannot modify header information - headers already sent by (output started at /home/wumpc14/public_html/wumpblog/wp-content/plugins/wp-last-visit.php:282) in /home/wumpc14/public_html/wumpblog/wp-comments-post.php on line 93
    Warning: Cannot modify header information - headers already sent by (output started at /home/wumpc14/public_html/wumpblog/wp-content/plugins/wp-last-visit.php:282) in /home/wumpc14/public_html/wumpblog/wp-comments-post.php on line 94
    Warning: Cannot modify header information - headers already sent by (output started at /home/wumpc14/public_html/wumpblog/wp-content/plugins/wp-last-visit.php:282) in /home/wumpc14/public_html/wumpblog/wp-comments-post.php on line 95
    Warning: Cannot modify header information - headers already sent by (output started at /home/wumpc14/public_html/wumpblog/wp-content/plugins/wp-last-visit.php:282) in /home/wumpc14/public_html/wumpblog/wp-comments-post.php on line 96
    Warning: Cannot modify header information - headers already sent by (output started at /home/wumpc14/public_html/wumpblog/wp-content/plugins/wp-last-visit.php:282) in /home/wumpc14/public_html/wumpblog/wp-comments-post.php on line 101

  2. oriecat
    Member
    Posted 10 years ago #

    What plugins are you using?

  3. danithew
    Member
    Posted 10 years ago #

    I've got most or all of Alex King's plugins going on, though I haven't gotten them all functioning yet... from the error message, this looks like the wp-last-visit plugin is involved.

  4. danithew
    Member
    Posted 10 years ago #

    I look at this and I've got to think that there are commands for headers in two different files that are clashing. Maybe I should just get rid of one of the commands? I feel like a monkey with a scalpel entering the OR here. But if you get a thousand monkeys doing surgery, one of them will perform a successful heart transplant ... or something like that.

  5. danithew
    Member
    Posted 10 years ago #

    looks like one of the complaints is regarding headers and wp-comments-post.php. It looks like the end of the code on that page has a lot of stuff going on with headers that could be triggering these error messages. Can I remove any of this without regretting it?
    this is the code I see that must be causing the problem:
    setcookie('comment_author_' . $cookiehash, $author, time() + 30000000, COOKIEPATH);
    setcookie('comment_author_email_' . $cookiehash, $email, time() + 30000000, COOKIEPATH);
    setcookie('comment_author_url_' . $cookiehash, $url, time() + 30000000, COOKIEPATH);
    header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
    header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
    header ('Cache-Control: no-cache, must-revalidate');
    header ('Pragma: no-cache');
    $location = (empty($_POST['redirect_to'])) ? $_SERVER["HTTP_REFERER"] : $_POST['redirect_to'];
    if ($is_IIS) {
    header("Refresh: 0;url=$location");
    } else {
    header("Location: $location");
    }
    ?>

  6. Mark (podz)
    Support Maven
    Posted 10 years ago #

    "Headers already sent" plus that bit just above ?
    I'd check the last visit plugin / file - it sets cookies.

  7. danithew
    Member
    Posted 10 years ago #

    I'm just trying to decide what I'm supposed to get rid of ... the cookies? A particular header command? I'll have to tinker with this a bit I think.

  8. Mark (podz)
    Support Maven
    Posted 10 years ago #

    It's the first error which is causing the snowball into more.
    Download wp-last-visit.php, and open it up in a text editor and then do the full checking for whitespace.
    Check also that if you inserted any information, you didn't have a leading space in that entry.

  9. danithew
    Member
    Posted 10 years ago #

    Podz,
    Thanks for pointing me to that specific file and mentioning "white space." That was the problem. It was so easy to fix once I knew what to look for. How embarassing.
    I'm going to brand it on my brain: "check for white space at the end of files!"

  10. Mark (podz)
    Support Maven
    Posted 10 years ago #

    At least it works :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.