...

View Full Version : PHP and 500 Internal server error



levani
09-22-2009, 12:47 PM
This is a beginning of my wordpress looop. On line 9 if I change if($comm->has_comment > 0) with while($comm->has_comment > 0) it generates Error 500! Internal Server Error! Can php cause 500 error?


<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>

<?php
$comm = get_comments_number( $id );

if($_GET['withcomments']) {
if($comm->has_comment > 0) {
?>

<?php echo $chemikitxvebi->post_author; ?>

<div class="post" id="post-<?php the_ID(); ?>">
<div class="gare_avatari"><?php echo get_avatar( get_the_author_id(), '50' ); ?></div>
<?php // if there's a thumbnail
if($thumb !== '') { ?>

<?php } // end if statement
// if there's not a thumbnail
else { echo ''; } ?>

<div class="satauri"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div><p class="post-footer align-left"><?php the_category(', ') ?> | </p>
<div style="clear:both"></div>
</div>
<?php
}

} elseif($_GET['withoutcomments']) {
if($comm < 1) {

Phil Jackson
09-22-2009, 01:59 PM
yeah, php is serverside, 500 error can only be achieved by error to the server.

Phil Jackson
09-22-2009, 01:59 PM
can you access an error log from your server?

abduraooft
09-22-2009, 02:09 PM
On line 9 if I change if($comm->has_comment > 0) with while($comm->has_comment > 0) it generates Error 500! Are you making any change to the variable $comm->has_comment inside that loop? If not, it'll be an infinite loop.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum