Parse error: syntax error, unexpected '<' in

Discussion in 'PHP' started by toucan1, Dec 10, 2009.

  1. #1
    I was editing the index file and did something wrong.

    Now get this message:
    Parse error: syntax error, unexpected '<' in....line 7

    I know it's simple but I can't figure out what I have done. I searched other posts but with no answer!


    <?php global $kriesi_options; get_header(); ?>

    <?php if($kriesi_options['fill_main'] == 1 || $kriesi_options['fill_main'] == ""){


    //*if you did choose: "edit by html" you can now edit the following lines: *//

    <div class="info_box box1">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"><a href="http://casitastenorio.com/?page_id=1"></span></a>
    <h2><a href= http://www.casitastenorio.com/?page_id=1>Welcome to Casitas Tenorio B&B </h2></a>
    <p>Experience the beauty and tranquility of rural Costa Rica from the comfort of your <a href="http://www.casitastenorio.com/accomodations/">own private casita</a> on our organic farm </p>
    <p>Watch hummingbirds and take a moment to admire the sloths in the trees.<br/><br/> Enjoy the real Costa Rica</p>
    </div>

    <div class="info_box box2">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"></span>
    <h2><a href="http://www.casitastenorio.com/tours/">Discover Rio Celeste</h2></a>
    <p>We are your Rio Celeste experts. We are located close to the Volcano Tenorio National Park and have the local knowledge to eu enjoy ensure you enjoy your trip. </p>
    <p><br/><br/>Take a <a href="http://www.casitastenorio.com/tours/"> horseback tour</a> or engage in some <a href=http://www.casitastenorio.com/tours/birding/"> birdwatching</a></p>
    </div>

    <div class="info_box box3">
    <div class="box_image"><!-- insert image here--></div>
    <span class="meta"></span>
    <h2><a href=http://www.casitastenorio.com/?page_id=7">Latest News</h2></a>
    <p>Check out all the latest news from Casitas Tenorio </p>
    <p><a href="http://www.casitastenorio.com/gallery/">Explore our Photo Gallery</p></a>
    <p><a href="http://www.casitastenorio.com/accomodations/">View our rooms</p></a>
    <p><a href="http://www.casitastenorio.com/about-us/rural-tourism//">Rural Tourism</p>
    <p><a href="http://www.casitastenorio.com/contact-us/">Contact Us</p></a></p>
    </div>

    <?php
    //stop editing here if you did choose "edit by html"


    }else if($kriesi_options['fill_main'] == 2){
    $query_string .= "&showposts=3";
    $query_string .= "&cat=".$kriesi_options['com_cat'];
    query_posts($query_string);
    $counter = 1;

    if (have_posts()) : while (have_posts()) : the_post();

    $preview_pic_mainpage = get_post_meta($post->ID, "preview_pic_mainpage", true);
    $punchline = get_post_meta($post->ID, "punchline", true);
    ?>


    <div class="info_box box<?php echo $counter; $counter++; ?>">
    <div class="box_image"><img src='<?php echo $preview_pic_mainpage; $preview_pic_mainpage =''; ?>' alt="" /></div>
    <span class="meta"><?php echo $punchline; $punchline='';?></span>
    <h2><?php the_title(); ?></h2>
    <?php the_content('Read more'); ?>
    <?php edit_post_link('Edit','', '' ); ?>
    </div>
    <?php endwhile; endif; ?>


    <?php } ?>
    <?php get_footer(); ?>
     
    toucan1, Dec 10, 2009 IP
  2. peter_anderson

    peter_anderson Notable Member

    Messages:
    3,382
    Likes Received:
    152
    Best Answers:
    0
    Trophy Points:
    240
    #2
    Your code is badly done.

    Anyway, all HTML code must be within echo.

    Eg:
    <?php echo 'hello world'; ?>
    Code (php):
     
    peter_anderson, Dec 10, 2009 IP
  3. lunarleviathan

    lunarleviathan Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You opened a PHP block and didn't close it with ?> before the raw HTML. Also you opened an if statement that is empty and not closed by }
     
    lunarleviathan, Dec 10, 2009 IP
  4. toucan1

    toucan1 Peon

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thank-you both so much, it must be annoying to see people make stupid mistakes and watching people mess things up so easily.

    You have seriously really helped me, I am in a very remote part of the world with NO ONE to ask about this.

    Smile, because you have really helped me out.
     
    toucan1, Dec 10, 2009 IP