I am utilizing a php if statement to show a picture when customers aren't drenched in, but however , a.) I am not great with php yet and b.) the if statement kicks my right sidebar into my #contentleft div, when they must be brothers and sisters. Do you know me what I am doing wrong here?

the code:

<div id="contentleft">

    <?php
    if ( is_user_logged_in() ) {
            echo 'Welcome, registered user!';

    } else {
            echo '<div id="intro"><p><a href="http://www.wespeakfashion.com/submissions">Sign up</a> and start posting!</p></div>';

    };
    ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>

    <p class="date"><b>Posted on</b> | <?php the_time('F j, Y'); ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p>
        <?php global $wpdb;
                $query = "SELECT `ID`, `guid` FROM `$wpdb->posts` WHERE `post_type` = 'attachment' AND `post_parent` = '{$post->ID}'";
                $adimages = $wpdb->get_results($wpdb->prepare($query), OBJECT);
        // To display the first image.. ?>

        <img style="float: center; height: 500px;" src="<?php if(is_public_submission()){echo $adimages[0]->guid;} ?>" />

    <?php the_content(__('Read more'));?><div style="clear:both;"></div>

    <div class="bt-links"><strong>Category:</strong> <?php the_category(', ') ?><br /><?php the_tags('<strong>Tags:</strong> ',' > '); ?></div>

    <!--
    <?php trackback_rdf(); ?>
    -->

    <h3>Comments</h3>
    <?php comments_template(); // Get wp-comments.php template ?>

    <?php endwhile; else: ?>

    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>

    </div>

<?php include(TEMPLATEPATH."/r_sidebar.php");?>

</div>

Thanks a lot.

I'm confused. You're such as the r_sidebar.php inside your #contentLeft div. Wouldn't it behove you to definitely move it from the div?

Rather than:

<?php include(TEMPLATEPATH."/r_sidebar.php");?>
</div>

Do:

</div>
<?php include(TEMPLATEPATH."/r_sidebar.php");?>

Sorry if that's not the solution (it appears too easy) but when you can elaborate in your problem, I am certain I may well be more help!