1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Parse error help...

Discussion in 'PHP & Perl' started by uditbhansali, Oct 21, 2011.

  1. uditbhansali

    uditbhansali Regular Member

    Joined:
    Aug 16, 2010
    Messages:
    486
    Likes Received:
    283
    Occupation:
    Ask your mom
    I'm getting this error and I can't find the problem.
    Can anyone help me pls

    Here's the error.

    Parse error: syntax error, unexpected $end in /home/folder/public_html/shalco/wp-content/themes/levitation/sidebar.php on line 12

    Here's the code:

    Code:
    <div class='boxxed boxxed_small boxxed3' id='sidebar' >
      <div class="widget widget_pages">
    <?php if ( is_page(array('2'))) { ?>
    <div class="e-left">
    <h3>E-Brochure</h3>
    <a href="http://shalco.in/SHALCO-Brochure.pdf" onclick="target='_blank'"><img src="http://shalco.in/images/Brochure.jpg" alt="E Brochure" /></a>
    </div>
    <div class="i-left">
    <h3>ISO Certified</h3>
    <a href="http://shalco.in/SHALCO-ISO.pdf" onclick="target='_blank'"><img src="http://shalco.in/images/SHALCO-ISO.jpg" alt="ISO Certification" /></a>
    </div>
    </div><!-- end sidebar -->
     
  2. fimms

    fimms Junior Member

    Joined:
    Apr 30, 2009
    Messages:
    178
    Likes Received:
    59
    Location:
    Fineland
    Home Page:
    Where is your ending curly bracket for <?php if ( is_page(array('2'))) { ?> ?

    Next ones are not a reason for parse error, but you should use " instead of ' on tag syntax like: id='sidebar'

    also onclick="target='_blank'" seems pretty strange?
     
  3. jazzc

    jazzc Moderator Staff Member Moderator Jr. VIP

    Joined:
    Jan 27, 2009
    Messages:
    2,468
    Likes Received:
    10,143
    Try adding
    PHP:
    <?php ?>
    at the end.
     
  4. fizzik

    fizzik Registered Member

    Joined:
    Apr 26, 2010
    Messages:
    53
    Likes Received:
    15
    Location:
    .au
    exactly what jazzc said

    you have an opening brace:

    Code:
    <?php if ( is_page(array('2'))) { ?>
    
    but no close brace for your statement