| | |
PHP parsing error, unexpected '<'
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 5
Reputation:
Solved Threads: 0
Help! I am brand new at writing php and have an error that I can't see. I am totally new at PHP and am wading in with both feet. I tried to change a header in my osCommerce store setup. I am making the changes in the header.php file and I am now getting the following error message: Parse error: parse error, unexpected '<' in /home/cteshopp/public_html/osCommerce/catalog/includes/header.php on line 17
ORIGINAL PHP
[php]<td valign="middle"><?php echo '<a href="' . tep_href_link (FILENAME_DEFAULT ) . '">' . tep_image(
DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?> </td>[/php]
OSCOMMERCE RECOMMENDED CHANGE TO PHP
[PHP] <td vAlign=center><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'your.gif', ‘your store name') . '</a>'; ?></td>[/PHP]
CURRENT PHP PROMPTING ERROR
[PHP] <TR class=header>
<TD vAlign=center><?php echo '<a href="' . tep_href_link (FILENAME_DEFAULT ) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></TD>
<TD vAlign=bottom align=right><?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[/PHP]
I know it something simple like a “ or ‘ or a . that is missing and is probably in one of the surrounding lines. I just don’t see it. Any help I can get will be greatly appreciated. Until I resolve this I can't get my osCommerce store to load! Is there a tool that helps you isolate errors?
ORIGINAL PHP
[php]<td valign="middle"><?php echo '<a href="' . tep_href_link (FILENAME_DEFAULT ) . '">' . tep_image(
DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?> </td>[/php]
OSCOMMERCE RECOMMENDED CHANGE TO PHP
[PHP] <td vAlign=center><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'your.gif', ‘your store name') . '</a>'; ?></td>[/PHP]
CURRENT PHP PROMPTING ERROR
[PHP] <TR class=header>
<TD vAlign=center><?php echo '<a href="' . tep_href_link (FILENAME_DEFAULT ) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></TD>
<TD vAlign=bottom align=right><?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[/PHP]
I know it something simple like a “ or ‘ or a . that is missing and is probably in one of the surrounding lines. I just don’t see it. Any help I can get will be greatly appreciated. Until I resolve this I can't get my osCommerce store to load! Is there a tool that helps you isolate errors?
Last edited by tgreer; Oct 30th, 2006 at 5:25 pm. Reason: Added code tags. Again.
•
•
Join Date: Jul 2004
Posts: 494
Reputation:
Solved Threads: 21
What helps sometimes is color highlighting. Proper use of code tags on the Daniweb boards gives you basic color highlighting as well as preserving indention to make code easier to read.
Where is line 17 in your source?
Where is line 17 in your source?
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
•
•
Join Date: Oct 2006
Posts: 5
Reputation:
Solved Threads: 0
Puckdropper. Thank you so much for the reply. I am so new at this that a few days ago I didn't know PHP existed! The best I can do is to cut and paste the entire file here or email the file. Sorry about being so daft at all of this. The only programming that I have ever done was in basic and I did it on the original TI when computers were just coming out. Then I learned DOS and it became history and here I am in the muck and mire of PHP. I am still searching for a good teaching guide on PHP. I didn't write the file and was only trying to change the .gif and store name and ended up with the error.
There are two ways that I can read the file. These are cut and pasted directly from the file. #1
[php]<?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 (c) 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 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR class=header>
<TD vAlign=center><?php echo '<a href="' . tep_href_link (FILENAME_DEFAULT ) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></TD>
<TD vAlign=bottom align=right><?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></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
<TBODY>
<TR class=headerNavigation>
<TD class=headerNavigation> <?php echo $breadcrumb->trail(' » '); ?></TD>
<TD class=headerNavigation align=right><?php if (tep_session_is_registered('customer_id')) { ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></A> | <?php } ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></A> | <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></A> | <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></A> </TD></TR></TBODY></TABLE><?php
if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=headerError>
<TD class=headerError><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></TD></TR></TBODY></TABLE><?php
}
if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=headerInfo>
<TD class=headerInfo><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></TD></TR></TBODY></TABLE><?php
}
?>[/php]
#2
[php]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'); } ?> [/php]
| | |
Sharron
There are two ways that I can read the file. These are cut and pasted directly from the file. #1
[php]<?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 (c) 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 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR class=header>
<TD vAlign=center><?php echo '<a href="' . tep_href_link (FILENAME_DEFAULT ) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></TD>
<TD vAlign=bottom align=right><?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></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
<TBODY>
<TR class=headerNavigation>
<TD class=headerNavigation> <?php echo $breadcrumb->trail(' » '); ?></TD>
<TD class=headerNavigation align=right><?php if (tep_session_is_registered('customer_id')) { ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></A> | <?php } ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></A> | <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></A> | <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></A> </TD></TR></TBODY></TABLE><?php
if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=headerError>
<TD class=headerError><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></TD></TR></TBODY></TABLE><?php
}
if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=headerInfo>
<TD class=headerInfo><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></TD></TR></TBODY></TABLE><?php
}
?>[/php]
#2
[php]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'); } ?> [/php]
| | |
Sharron
Last edited by tgreer; Oct 30th, 2006 at 5:22 pm. Reason: User didn't use code tags.
•
•
Join Date: Jul 2004
Posts: 494
Reputation:
Solved Threads: 21
Please wrap code in [ code ] tags. (No spaces.) When done, simply turn off the code tag with a slash. [ /code ]
This is part of the operational theory for HTML, too, which most PHP scripts output.
This is part of the operational theory for HTML, too, which most PHP scripts output.
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
And formatting Sharron's cut-and-paste because she clearly isn't familiar with that function:
#1
[php]<?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 (c) 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 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR class=header>
<TD vAlign=center><?php echo '<a href="' . tep_href_link (FILENAME_DEFAULT ) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></TD>
<TD vAlign=bottom align=right><?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></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
<TBODY>
<TR class=headerNavigation>
<TD class=headerNavigation> <?php echo $breadcrumb->trail(' » '); ?></TD>
<TD class=headerNavigation align=right><?php if (tep_session_is_registered('customer_id')) { ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></A> | <?php } ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></A> | <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></A> | <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></A> </TD></TR></TBODY></TABLE><?php
if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=headerError>
<TD class=headerError><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></TD></TR></TBODY></TABLE><?php
}
if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=headerInfo>
<TD class=headerInfo><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></TD></TR></TBODY></TABLE><?php
}
?>[/php]
#1
[php]<?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 (c) 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 cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR class=header>
<TD vAlign=center><?php echo '<a href="' . tep_href_link (FILENAME_DEFAULT ) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></TD>
<TD vAlign=bottom align=right><?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></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>
<TBODY>
<TR class=headerNavigation>
<TD class=headerNavigation> <?php echo $breadcrumb->trail(' » '); ?></TD>
<TD class=headerNavigation align=right><?php if (tep_session_is_registered('customer_id')) { ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></A> | <?php } ?><A class=headerNavigation href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></A> | <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></A> | <A class=headerNavigation href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></A> </TD></TR></TBODY></TABLE><?php
if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=headerError>
<TD class=headerError><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></TD></TR></TBODY></TABLE><?php
}
if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) {
?>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
<TBODY>
<TR class=headerInfo>
<TD class=headerInfo><?php echo htmlspecialchars($HTTP_GET_VARS['info_message']); ?></TD></TR></TBODY></TABLE><?php
}
?>[/php]
•
•
Join Date: Jul 2004
Posts: 494
Reputation:
Solved Threads: 21
I think I figured it out... It's such a weird error, I'd have never thought to look for it. When I copied and pasted the code to my code editor (a souped up version of Notepad called ConText) and it showed most the code, starting at the comment
Try editing the file and putting the comment on its own line. Something like:
You may have to look for other places where you need to put the code on seperate lines, it's a simple matter of looking for semicolons and braces (curly brackets or { }), I'm sure. (PHP uses semicolons to end lines, HTML sometimes uses them to end entities, but I don't think the system would care about too many new lines.
// check if the configure.php file is writeable, as being on one line.Try editing the file and putting the comment on its own line. Something like:
PHP Syntax (Toggle Plain Text)
$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'); } ?>
You may have to look for other places where you need to put the code on seperate lines, it's a simple matter of looking for semicolons and braces (curly brackets or { }), I'm sure. (PHP uses semicolons to end lines, HTML sometimes uses them to end entities, but I don't think the system would care about too many new lines.
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
•
•
Join Date: Oct 2006
Posts: 5
Reputation:
Solved Threads: 0
Snowdog, you were so sweet to post the formatted text for me. FYI all I did was replace my gif and store name and left the other text and then received the parse error. I was editing through vDeck which apparently is a no no because it adds unwanted commands, like \'s, to the existing code. osCommerce has a site where you can post problems and this appears to be a common problem. I have learned that there are a multitude of osCommerce users having parse error problems. These users were using Front Page, notepad, and other editing tools including OSC's tool.
Since my last post I downloaded EngSite Editor for PHP and used their debugging tool. Thanks to Snowdog and the editor I now know how A posting should look. The editor tells me which lines have an errors, but not how to fix them. I am trying to get an original copy of the file before editing it, so I can keep an original and see what changes when I use the editing tool.
Thank you Puckdropper for the advice on basic formatting. I did try to re-structure the lines in the EngSite editor and asked it to run and I still had a parse error on line 13. I will take your suggestions and give it another try.
I want to thank both of you for taking the time to try to help someone who is brand new to php. I have learned a lot in a week. #1 lesson NEVER MAKE CHANGES TO THE ORIGINAL FILE - USE A COPY - TEST IT AND THEN REPLACE THE ORIGINAL!
Sharron
Since my last post I downloaded EngSite Editor for PHP and used their debugging tool. Thanks to Snowdog and the editor I now know how A posting should look. The editor tells me which lines have an errors, but not how to fix them. I am trying to get an original copy of the file before editing it, so I can keep an original and see what changes when I use the editing tool.
Thank you Puckdropper for the advice on basic formatting. I did try to re-structure the lines in the EngSite editor and asked it to run and I still had a parse error on line 13. I will take your suggestions and give it another try.
I want to thank both of you for taking the time to try to help someone who is brand new to php. I have learned a lot in a week. #1 lesson NEVER MAKE CHANGES TO THE ORIGINAL FILE - USE A COPY - TEST IT AND THEN REPLACE THE ORIGINAL!
Sharron
•
•
Join Date: Oct 2006
Posts: 5
Reputation:
Solved Threads: 0
I am now getting this parse error in the EnginSite Editor:
PHP Parse error: parse error, unexpected '<' in C:\Documents and Settings\Owner\My Documents\PHPtest2.php on line 11. Which is the following line:
[html]<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>[/html]
PHP Parse error: parse error, unexpected '<' in C:\Documents and Settings\Owner\My Documents\PHPtest2.php on line 11. Which is the following line:
[html]<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>[/html]
Last edited by tgreer; Oct 30th, 2006 at 5:24 pm. Reason: User still not using code tags.
![]() |
Similar Threads
Other Threads in the PHP Forum
- Previous Thread: PHP Upgrade-need to down apache?
- Next Thread: The mysterious errors of PHP
| Thread Tools | Search this Thread |
5.2.10 action apache api array beginner beneath binary broken cakephp checkbox class classes cms code cron curl database date destroy display dynamic echo echo$_get[x]changingitintovariable... email encode error fcc file files folder form forms function functions google header howtowriteathesis href htaccess html image images include insert ip javascript joomla limit link local login mail memberships menu mlm mod_rewrite multiple multipletables mysql mysqlquery neutrality oop open passwords paypal pdf php provider query radio random record remote rss script search server sessions sockets source space sql strip_tags syntax system table template thesishelp tutorial update upload url validator variable video voteup web window.onbeforeunload=closeme; youtube





