Parse error: syntax error, unexpected T_ENDIF in form.php file

Discussion in 'PHP' started by CheapSEO, Jul 31, 2011.

  1. #1
    Hi,

    I checked all code, but couldn't find simple error. Can you help me please.
    I'm showing this error.

    Parse error: syntax error, unexpected T_ENDIF in form.php file

    code is
    <?PHP endif; ?>
    PHP:

     
    Last edited: Jul 31, 2011
    CheapSEO, Jul 31, 2011 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,897
    Likes Received:
    4,555
    Best Answers:
    123
    Trophy Points:
    665
    #2
    That's not the line with the error. You'll have something wrong higher up in your code. Check your braces {} and endif; throughout your script or post the file.
     
    sarahk, Jul 31, 2011 IP
  3. victa

    victa Peon

    Messages:
    400
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yep, there's un closed statement. if you're using a decent code editor it can tell you the pair of {} or if statement and you can easily find where's the still open if statement. sorry for my bad english.
     
    victa, Jul 31, 2011 IP
  4. freelanceinphp

    freelanceinphp Member

    Messages:
    134
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #4
    can you please post whole code? because only this code couldn't easily understand your problem.
     
    freelanceinphp, Aug 1, 2011 IP
  5. pooriafd

    pooriafd Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi Guys i have had same problem, the point is i haven't changed the code, i have tried to change flash part, i might have deleted something i would be really grateful if you can help me with this, i'm really disparate
    this is the code:
    <div id="sidebar">
    <ul id="sidelist">
    <?php     /* Widgetized sidebar, if you have the plugin installed. */
                        if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Regular Sidebar') ) 
    : ?>
    
        <?php
    // this is where 10 headlines from the current category get printed      
    if ( is_single() ) :
    global $post;
    $categories = get_the_category();
    foreach ($categories as $category) :
    ?>
        <li>
          <h2><?php _e('Mer från denna kategori','branfordmagazine');?></h2>
          <ul class="bullets">
            <?php
    $posts = get_posts('numberposts=10&category='. $category->term_id);
    foreach($posts as $post) :
    ?>
            <li><a href="<?php the_permalink(); ?>">
              <?php the_title(); ?>
              </a></li>
            <?php endfmaoreach; ?>
            <li><strong><a href="<?php echo get_category_link($category->term_id);?>" title="<?php _e('Se alla poster från 
    
    
    denna kategori','branfordmagazine');?> <?php echo $category->name; ?>"><?php _e('Arkiv för','branfordmagazine');?> '<?php 
    
    
    echo $category->name; ?>' &raquo;</a></strong></li>
          </ul>
        </li>
        <?php endforeach; endif ; ?>
        <?php if ( is_home() ) { ?>
        <li>
          <h3>
            <?php 
        // this is where the name of the News (or whatever) category gets printed      
        wp_list_categories('include=1&title_li=&style=none'); ?>
          </h3>
          <?php 
    // this is where the last five headlines are pulled from the News (or whatever) category
            query_posts('showposts=5&offset=0&cat=5');      
            ?>
          <ul class="bullets">
            <?php while (have_posts()) : the_post(); ?>
            <li><a href="<?php the_permalink() ?>" rel="bookmark">
              <?php the_title(); ?>
              </a></li>
            <?php endwhile; ?>
          </ul>
        </li>
        <?php } ?>
        <li>
    
    
    
    
    <!-- RECENT POSTS -->
     
        <h3>Nyheter</h3>
      
        <?php wp_get_archives('type=postbypost&limit=5'); ?>
      
      <!-- END RECENT POSTS -->
         
        </li>
    
    
    
    
    
    
    
    
    
    
        <li>
          <h3><?php _e('Se Amadeusfilmen här!','branfordmagazine');?></h3>
    
    
    <object width="250" height="205"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" 
    
    
    value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?
    
    
    clip_id=5974160&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00adef&amp;fullscree
    
    
    n=1" /><embed src="http://vimeo.com/moogaloop.swf?
    
    
    clip_id=5974160&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00adef&amp;fullscree
    
    
    n=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="250" 
    
    
    height="205"></embed></object><p><a href="http://vimeo.com/5974160"></a></p>
    
    
        
        <li>
          <h3><?php _e('Alla tidigare inlägg','branfordmagazine');?></h3>
          <ul class="feed">
            <li><a href="<?php bloginfo('rss2_url'); ?>">Inlägg (RSS)</a></li>
         
          </ul>
        </li>
    
    
    
    
    
    
        
      <?php endif; ?>
      </ul>
      <!--END SIDELIST-->
    </div>
    <!--END SIDEBAR-->
    PHP:
     
    Last edited: Nov 13, 2012
    pooriafd, Nov 13, 2012 IP
  6. dung hoang

    dung hoang Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #6
    you open file php.ini next set: short_open_tag = On
     
    dung hoang, Nov 29, 2013 IP
  7. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #7
    Dirty code.

    Mixing PHP and HTML, No indentation formatting, No use of brackets..... No wonder why you can't spot the error.... Start over with learning PHP because whoever (or wherever) taught you did a horrible job!
     
    NetStar, Dec 1, 2013 IP
  8. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #8
    It's Wordpress. It ships with dirt all over it by default. Not the poor guy's fault, to be fair.
     
    nico_swd, Dec 2, 2013 IP