Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder levani's Avatar
    Join Date
    Mar 2009
    Location
    Georgia
    Posts
    183
    Thanks
    29
    Thanked 1 Time in 1 Post

    PHP and 500 Internal server error

    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 Code:
    <?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_avatarget_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) {

  • #2
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    yeah, php is serverside, 500 error can only be achieved by error to the server.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #3
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    can you access an error log from your server?
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    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.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •