peacelight Posted February 18, 2008 Posted February 18, 2008 I am getting the following error :huh: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/peacelig/public_html/admin/includes/header.php on line 19 here is my code if someone could help me I would appreciate it <?php/* $Id: header.php,v 1.42 2003/06/10 18:20:38 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License*/// check if the 'install' directory exists, and warn of its existence if (WARN_INSTALL_EXISTENCE == 'true') { if (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/install')) { $messageStack->add('header', WARNING_INSTALL_DIRECTORY_EXISTS, 'warning'); } }// check if the configure.php file is writeable if (WARN_CONFIG_WRITEABLE == 'true') { if ( (file_exists(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) && (is_writeable(dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']) . '/includes/configure.php')) ) { $messageStack->add('header', WARNING_CONFIG_FILE_WRITEABLE, 'warning'); } }// check if the session folder is writeable if (WARN_SESSION_DIRECTORY_NOT_WRITEABLE == 'true') { if (STORE_SESSIONS == '') { if (!is_dir(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NON_EXISTENT, 'warning'); } elseif (!is_writeable(tep_session_save_path())) { $messageStack->add('header', WARNING_SESSION_DIRECTORY_NOT_WRITEABLE, 'warning'); } } }// check session.auto_start is disabled if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) { if (ini_get('session.auto_start') == '1') { $messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning'); } } if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) { if (!is_dir(DIR_FS_DOWNLOAD)) { $messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning'); } } if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); }?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'os.jpeg', 'Sample Site ') . '</a>'; ?></td> <td align="right" valign="bottom"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?> </td> </tr></table><table border="0" width="100%" cellspacing="0" cellpadding="1"> <tr class="headerNavigation"> <td class="headerNavigation"> <?php echo $breadcrumb->trail(' » '); ?></td> <td align="right" class="headerNavigation"><?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a> | <?php } ?><a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a> | <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_CHECKOUT; ?></a> </td> </tr></table><?php if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {?><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerError"> <td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td> </tr></table><?php } if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {?><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerInfo"> <td class="headerInfo"><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></td> </tr></table><?php }?>
Guest Posted February 18, 2008 Posted February 18, 2008 admin/includes/header.php on line 19 Can you see which is line 19?
germ Posted February 18, 2008 Posted February 18, 2008 That's the header.php from your /includes folder (your catalog), not from your /admin/includes. The one from the admin will probably look more like this: <?php /* $Id: header.php,v 1.19 2002/04/13 16:11:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ if ($messageStack->size > 0) { echo $messageStack->output(); } ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td> <td align="right"><?php echo '<a href="http://www.oscommerce.com" target="_blank">' . tep_image(DIR_WS_IMAGES . 'header_support.gif', HEADER_TITLE_SUPPORT_SITE, '50', '50') . '</a> <a href="' . tep_catalog_href_link() . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_ONLINE_CATALOG, '53', '50') . '</a> <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_administration.gif', HEADER_TITLE_ADMINISTRATION, '50', '50') . '</a>'; ?> </td> </tr> <tr class="headerBar"> <td class="headerBarContent"> <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_TOP . '</a>'; ?></td> <td class="headerBarContent" align="right"><?php echo '<a href="http://www.oscommerce.com" class="headerLink">' . HEADER_TITLE_SUPPORT_SITE . '</a> | <a href="' . tep_catalog_href_link() . '" class="headerLink">' . HEADER_TITLE_ONLINE_CATALOG . '</a> | <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_ADMINISTRATION . '</a>'; ?> </td> </tr> </table> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
peacelight Posted February 18, 2008 Author Posted February 18, 2008 That's the header.php from your /includes folder (your catalog), not from your /admin/includes. The one from the admin will probably look more like this: <?php /* $Id: header.php,v 1.19 2002/04/13 16:11:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ if ($messageStack->size > 0) { echo $messageStack->output(); } ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td> <td align="right"><?php echo '<a href="http://www.oscommerce.com" target="_blank">' . tep_image(DIR_WS_IMAGES . 'header_support.gif', HEADER_TITLE_SUPPORT_SITE, '50', '50') . '</a> <a href="' . tep_catalog_href_link() . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_ONLINE_CATALOG, '53', '50') . '</a> <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_administration.gif', HEADER_TITLE_ADMINISTRATION, '50', '50') . '</a>'; ?> </td> </tr> <tr class="headerBar"> <td class="headerBarContent"> <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_TOP . '</a>'; ?></td> <td class="headerBarContent" align="right"><?php echo '<a href="http://www.oscommerce.com" class="headerLink">' . HEADER_TITLE_SUPPORT_SITE . '</a> | <a href="' . tep_catalog_href_link() . '" class="headerLink">' . HEADER_TITLE_ONLINE_CATALOG . '</a> | <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_ADMINISTRATION . '</a>'; ?> </td> </tr> </table> thank you hear it is<?php /* $Id: header.php,v 1.19 2002/04/13 16:11:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License */ if ($messageStack->size > 0) { echo $messageStack->output(); } ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><?php echo tep_image(DIR_WS_IMAGES . 'os.jpeg', 'store' '204', '50'); ?></td> <td align="right"><?php echo '<a href="http://www.oscommerce.com" target="_blank">' . tep_image(DIR_WS_IMAGES . 'header_support.gif', HEADER_TITLE_SUPPORT_SITE, '50', '50') . '</a> <a href="' . tep_catalog_href_link() . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_ONLINE_CATALOG, '53', '50') . '</a> <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_administration.gif', HEADER_TITLE_ADMINISTRATION, '50', '50') . '</a>'; ?> </td> </tr> <tr class="headerBar"> <td class="headerBarContent"> <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_TOP . '</a>'; ?></td> <td class="headerBarContent" align="right"><?php echo '<a href="http://www.oscommerce.com" class="headerLink">' . HEADER_TITLE_SUPPORT_SITE . '</a> | <a href="' . tep_catalog_href_link() . '" class="headerLink">' . HEADER_TITLE_ONLINE_CATALOG . '</a> | <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_ADMINISTRATION . '</a>'; ?> </td> </tr> </table>
peacelight Posted February 18, 2008 Author Posted February 18, 2008 That's the header.php from your /includes folder (your catalog), not from your /admin/includes. The one from the admin will probably look more like this: <?php /* $Id: header.php,v 1.19 2002/04/13 16:11:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ if ($messageStack->size > 0) { echo $messageStack->output(); } ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td> <td align="right"><?php echo '<a href="http://www.oscommerce.com" target="_blank">' . tep_image(DIR_WS_IMAGES . 'header_support.gif', HEADER_TITLE_SUPPORT_SITE, '50', '50') . '</a> <a href="' . tep_catalog_href_link() . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_ONLINE_CATALOG, '53', '50') . '</a> <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_administration.gif', HEADER_TITLE_ADMINISTRATION, '50', '50') . '</a>'; ?> </td> </tr> <tr class="headerBar"> <td class="headerBarContent"> <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_TOP . '</a>'; ?></td> <td class="headerBarContent" align="right"><?php echo '<a href="http://www.oscommerce.com" class="headerLink">' . HEADER_TITLE_SUPPORT_SITE . '</a> | <a href="' . tep_catalog_href_link() . '" class="headerLink">' . HEADER_TITLE_ONLINE_CATALOG . '</a> | <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_ADMINISTRATION . '</a>'; ?> </td> </tr> </table> I fixed it by copying this file up<?php /* $Id: header.php,v 1.19 2002/04/13 16:11:52 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License */ if ($messageStack->size > 0) { echo $messageStack->output(); } ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td> <td align="right"><?php echo '<a href="http://www.oscommerce.com" target="_blank">' . tep_image(DIR_WS_IMAGES . 'header_support.gif', HEADER_TITLE_SUPPORT_SITE, '50', '50') . '</a> <a href="' . tep_catalog_href_link() . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_ONLINE_CATALOG, '53', '50') . '</a> <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_administration.gif', HEADER_TITLE_ADMINISTRATION, '50', '50') . '</a>'; ?> </td> </tr> <tr class="headerBar"> <td class="headerBarContent"> <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_TOP . '</a>'; ?></td> <td class="headerBarContent" align="right"><?php echo '<a href="http://www.oscommerce.com" class="headerLink">' . HEADER_TITLE_SUPPORT_SITE . '</a> | <a href="' . tep_catalog_href_link() . '" class="headerLink">' . HEADER_TITLE_ONLINE_CATALOG . '</a> | <a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '" class="headerLink">' . HEADER_TITLE_ADMINISTRATION . '</a>'; ?> </td> </tr> </table>
♥FWR Media Posted February 18, 2008 Posted February 18, 2008 I fixed it by copying this file up Glad you fixed it. No help from Germ or Coopco then :rolleyes: Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
germ Posted February 18, 2008 Posted February 18, 2008 The "bad" line was this one: <td><?php echo tep_image(DIR_WS_IMAGES . 'os.jpeg', 'store' '204', '50'); ?></td> Should have been: <td><?php echo tep_image(DIR_WS_IMAGES . 'os.jpeg', 'store', '204', '50'); ?></td> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
germ Posted February 18, 2008 Posted February 18, 2008 Robert..... :P ;) :lol: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
christiansees Posted February 18, 2008 Posted February 18, 2008 Hello all, I am having the same error message Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/ouraccount/public_html/Shop/includes/header.php on line 59 The only difference is that the line number is 59, which is the 6th line of the code block pasted below. I have looked and looked at this code and I can't find the error any help would be appreciated. Unfortunately as this is a custom header file I can not just paste in the stock OsCommerce code to repair it. Thanks <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td align="left" valign="middle"><?php echo '<a href="http://www.oursite.com/" target="_blank">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td> <?php if (tep_session_is_registered('customer_id')){ ?> <?php echo'<td align="left" valign="middle"><a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF)'</a></td>'}; ?> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT)'</a>'; ?></td> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS)'</a>'; ?></td> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT)'</a>'; ?></td> </tr> </table> On your last day only you will have to approve or disaprove of how your life has been.
germ Posted February 18, 2008 Posted February 18, 2008 This: HEADER_TITLE_LOGOFF)'</a></td>'}; ?> Probably should be: HEADER_TITLE_LOGOFF)'</a></td>';} ?> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
christiansees Posted February 18, 2008 Posted February 18, 2008 Germ, Thanks for the suggestion, unfortunately it did not work. Also the curly brace closes the command executed by the if statement while the ; closes the if statement it's self. So for proper nesting the command executed by the if should end before the if it's self. I my self have been staring at this code for far too long so any and all suggestions are welcome. Thanks On your last day only you will have to approve or disaprove of how your life has been.
germ Posted February 18, 2008 Posted February 18, 2008 Same error, same line? :unsure: Regardless, the } belongs outside the ; If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
germ Posted February 18, 2008 Posted February 18, 2008 I got it!!! HEADER_TITLE_LOGOFF) . '</a></td>';} ?> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
christiansees Posted February 18, 2008 Posted February 18, 2008 Hello again, Thanks again for your reply Germ. I did try your suggestion and I did get the same error for the same line. Also for the reasons that I stated above I don't think that it is the correct solution syntactically. I do however very much appreciate your taking a look. thanks Christian On your last day only you will have to approve or disaprove of how your life has been.
germ Posted February 18, 2008 Posted February 18, 2008 This works (with no parse error): <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td align="left" valign="middle"><?php echo '<a href="http://www.oursite.com/" target="_blank">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td> <?php if (tep_session_is_registered('customer_id')){ ?> <?php echo'<td align="left" valign="middle"><a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) . '</a></td>';} ?> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>'; ?></td> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>'; ?></td> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?></td> </tr> </table> I've tried it on a test page. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
♥FWR Media Posted February 18, 2008 Posted February 18, 2008 <nips in to give germ an (organic ofc) energy boosting drink> <runs back to the beer> Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
germ Posted February 19, 2008 Posted February 19, 2008 <nips in to give germ an (organic ofc) energy boosting drink> <runs back to the beer> Hmmmm.... Beer is made from grains and hops & such... That's organic... And it has alcohol in it... That's "energy".... Does that mean I get beer, Robert? :unsure: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
♥FWR Media Posted February 19, 2008 Posted February 19, 2008 Hmmmm.... Beer is made from grains and hops & such... That's organic... And it has alcohol in it... That's "energy".... Does that mean I get beer, Robert? :unsure: Not mine no ... <runs away with a handful of cans> Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
christiansees Posted February 19, 2008 Posted February 19, 2008 Funny I tried the same thing Parse error: syntax error, unexpected '<' in /home/intern25/public_html/test.php on line 2 On your last day only you will have to approve or disaprove of how your life has been.
germ Posted February 19, 2008 Posted February 19, 2008 The reason the } belongs outside the ; is this: The ; terminates the echo '.... The } terminates the "if ...... You must terminate the "echo " before the "if". Obviously your test script isn't setup correctly. <?php ?> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td align="left" valign="middle"><?php echo '<a href="http://www.oursite.com/" target="_blank">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td> <?php if (tep_session_is_registered('customer_id')){ ?> <?php echo'<td align="left" valign="middle"><a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) . '</a></td>';} ?> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>'; ?></td> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>'; ?></td> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?></td> </tr> </table> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
christiansees Posted February 19, 2008 Posted February 19, 2008 Forgot to mention this is a php 4.4+ server HTH On your last day only you will have to approve or disaprove of how your life has been.
christiansees Posted February 19, 2008 Posted February 19, 2008 Then what terminates the if? I even tried ;}; On your last day only you will have to approve or disaprove of how your life has been.
germ Posted February 19, 2008 Posted February 19, 2008 Just for the record, I had the script embedded in a much larger page of code. The } terminates the "if (,...) {" This is what I have again, that works, in case I mis-pasted before: <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td align="left" valign="middle"><?php echo '<a href="http://www.oursite.com/" target="_blank">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td> <?php if (tep_session_is_registered('customer_id')){ ?> <?php echo'<td align="left" valign="middle"><a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) . '</a></td>';} ?> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a>'; ?></td> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>'; ?></td> <td align="left" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a>'; ?></td> </tr> </table> If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
♥FWR Media Posted February 19, 2008 Posted February 19, 2008 in case I mis-pasted before You stole one of my beers! I knew it!!! @christiansees I'm normally helpful sorry .. can't resist tonight. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
germ Posted February 19, 2008 Posted February 19, 2008 This works too: <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr class="header"> <td align="left" valign="middle"><?php echo '<a href="http://www.oursite.com/" target="_blank">' . tep_image(DIR_WS_IMAGES . 'shield.gif', 'Home') . '</a>'; ?></td> <?php if (tep_session_is_registered('customer_id')){ echo'<td align="left" valign="middle"><a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_logoff.gif', HEADER_TITLE_LOGOFF) . '</a></td>'; } echo '<td align="left" valign="middle">' . '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_account.gif', HEADER_TITLE_MY_ACCOUNT) . '</a></td>'; echo '<td align="left" valign="middle">' . '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a></td>'; echo '<td align="left" valign="middle">' . '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_checkout.gif', HEADER_TITLE_CHECKOUT) . '</a></td>'; ?> </tr> </table> <wiping (stolen) beer foam from my lips> </w> :) If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Recommended Posts
Archived
This topic is now archived and is closed to further replies.