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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    New Coder
    Join Date
    Mar 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Parse error: syntax error, unexpected '}'

    I cannot find out why I keep getting this error message could someone help me out with it. Thanks for any help.

    [PHP
    if (isset($HTTP_GET_VARS['pID'])) {
    echo tep_image_submit('button_update.gif', IMAGE_UPDATE);
    } else {
    echo tep_image_submit('button_insert.gif', IMAGE_INSERT);
    }
    echo '&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';
    ?>
    </td>
    </tr>
    <?php
    }
    ?>
    </table></form>
    <?php
    } else {
    ?>
    <table border="0" summary="" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
    <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td>
    ][/PHP]

  • #2
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    It's not exactly hard to spot where your problem is, if you look.

    Code:
    <?php
    }
    ?>
    </table></form>
    <?php
    } else {
    ?>

  • #3
    New Coder
    Join Date
    Mar 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry Im new to php and I dont see what is wrong. What do I need to fix?
    Last edited by wheel; 03-28-2010 at 06:07 AM.

  • #4
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Delete everything except for:

    Code:
    </table></form>
    from that snippet I posted. That is assuming that what you've posted is the complete code. If it is, your HTML layout is screwed. If it isn't, post all of your code instead of selected snippets, plus the complete error message.
    Last edited by MattF; 03-28-2010 at 06:33 AM.

  • #5
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    PHP Code:
    <?php
    if (isset($HTTP_GET_VARS['pID'])) {
    echo 
    tep_image_submit('button_update.gif'IMAGE_UPDATE);
    } else {
    echo 
    tep_image_submit('button_insert.gif'IMAGE_INSERT);
    }
    echo 
    '&nbsp;&nbsp;<a href="' tep_href_link(FILENAME_CATEGORIES'cPath=' $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' $HTTP_GET_VARS['pID'] : '')) . '">' tep_image_button('button_cancel.gif'IMAGE_CANCEL) . '</a>';
    ?>
    </td>
    </tr>

    </table></form>
    <table border="0" summary="" width="100%" cellspacing="0" cellpadding="2">
    <tr>
    <td><table border="0" summary="" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td class="pageHeading"><?php echo HEADING_TITLE?></td>
    <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif'1HEADING_IMAGE_HEIGHT); ?></td>
    Last edited by masterofollies; 03-28-2010 at 06:16 PM.
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #6
    Regular Coder
    Join Date
    Jan 2010
    Posts
    153
    Thanks
    53
    Thanked 0 Times in 0 Posts
    You forgot to close the "else" brackets.

    Add this line at the end of your code:

    PHP Code:
    <?php ?>

  • #7
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    I sure did, edited
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #8
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    The code the OP posted is actually missing an opening if statement. Even which the bracket removed you will still get an error which means all of the code was posted. Also $HTTP_GET_VARS shouldn't be used anymore. $_GET for $HTTP_GET_VARS should be used and $_POST for $HTTP_POST_VARS should be used.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #9
    New Coder
    Join Date
    Mar 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you need me to post more code? I tried but the forum keeps telling me that it is to big. Any advice or can you tell me how much of the code that you need. Thanks for the help.

    error message
    Parse error: syntax error, unexpected '}' in /home/content..............categories.php on line 896
    Last edited by wheel; 03-28-2010 at 07:03 PM.

  • #10
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Can you post the entire code, so we can see where line 896 is?
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #11
    New Coder
    Join Date
    Mar 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok I was finally able to get the whole file in a zip file. Let me know if that works. Thanks for the help again.
    Attached Files Attached Files

  • #12
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Ok try this and see if it works.
    Attached Files Attached Files
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #13
    New Coder
    Join Date
    Mar 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi thanks for your help with this. I am now getting the error message.

    Parse error: syntax error, unexpected T_ELSE in /home/content/........./categories.php on line 896

  • #14
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Ah I think I got it, there is a double else statement. Try this one.
    Attached Files Attached Files
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #15
    New Coder
    Join Date
    Mar 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Parse error: syntax error, unexpected '}' in /home/...........categories.php on line 894

    After installing the revised categories I got this error message.

    Thanks for helping me out with this.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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