WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: SI CAPTCHA Anti-Spam] Warning: session_start() [function.session-start]: Cannot send sessio (2 posts)

  1. kwporg
    Member
    Posted 4 years ago #

    WP 2.8.4
    Theme is Ocadia 1.3

    Works fine when actually in the blog.

    I display a couple posts on my home page using the following code:

    <?php
        // Include WordPress
        define('WP_USE_THEMES', false);
        require('amiga/amigablog/wp-blog-header.php');
        query_posts('showposts=2');
        ?>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <link rel="icon" type="image/p'
    ..........

    at the top of my index.php file and where I want the posts

    <div id="content">
        <!-- mini loop for the excerpts -->
                                <?php while (have_posts()): the_post(); ?>
                                   <h2><?php the_title(); ?></h2>
                                      <?php the_excerpt(); ?>
                                   <p><a href="<?php the_permalink(); ?>" class="text1">Read more...</a></p>
                                <?php endwhile; ?>
                                <!-- end the mini loop -->
    </div>

    I'm sure this code is what's breaking compatibility, is there a fix?

    Warning message:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at <SNIP>/html/index.php:1) in <SNIP>/amiga/amigablog/wp-content/plugins/si-captcha-for-wordpress/si-captcha.php on line 859

    Appreciate any help.

    Keith

    http://wordpress.org/extend/plugins/si-captcha-for-wordpress/

  2. Mike Challis
    Member
    Posted 4 years ago #

    Try this:

    This code must be at the top of your PHP script:

    <?php
     # session_start is required for the captcha-image to function,
     # and must be at the very top of the PHP script."
     # session_start() must be processed before any other output
     # or you might get a warning "headers already sent".
      if( !isset( $_SESSION ) ) {
        session_start();
      }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic