Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

header.php file has parse error


CTE_Shopping

Recommended Posts

Posted

:sweating: PLEASE HELP ME! I AM NOW IN CRITICAL MODE! I can't open my online store and therefore I am out of business until I am fix the problem. I learned a hard lesson. I will now use a copy of a file to make the changes and test it before putting the php language into the working file. I desperately need the ORIGINAL header.php file code. I tried to change the osCommerce header to my store header through vDeck and now I am getting parse errors. Apparently vDeck adds symbols to the machine language that really messes up your file. I need to start from scratch.

 

I posted the file with errors on two IT sites and receive a slap on the wrist for not posting it properly and some techie advice that was more confusing than PHP.

 

I downloaded a PHP editing program that debugs and it tells me what line(s) the error is in, but it does not tell me how to fix it.

 

I posting a request on the osCommerce debugging site, but have not received a reply. I am really getting desperate now. My store needs to go online in the next 24-hours.

 

I am afraid to reload osCommerce for fear of deleting all my store catalog entries. Plus, I noticed that someone else tried this and things got worse instead of resolving the problem.

 

The file is located on the following path from my vDeck console:

filemanager/public_html/oscommerce/catalog/includes/header.php

There are many failures on the road to success. We stumble over pebbles, not mountains. Never give up!

Posted
The file is located on the following path from my vDeck console:

filemanager/public_html/oscommerce/catalog/includes/header.php

Perhaps post your file here and the error message/s you are receiving (the above link is inaccessible to everyone but yourself ;)).

 

Also, information on what you changed might help. :)

Posted

The only thing I attempted to change in this file was my store.gif and store name. I received a parse error, so I put the file back to what I believed was the original code. Instead, I continued to receive a parse error. I have included the code for the entire file. I hope I used the proper posting format for this forum. I have EnginSite Editor for PHP and when I run a test on it to debug it I was given the following error.

 

PHP Parse error: parse error, unexpected '<' in C:\Documents and Settings\Owner\My Documents\PHPtest3.php on line 17, which is <TABLE cellSpacing=0 cellPadding=1 width="100%" border=0>

 

<?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
 }
?>

 

At this point I would be happy to have a copy of the original file, but I have no idea how to get it unless I download an entire set of osCommerce files and then replace the current file with an original copy.

There are many failures on the road to success. We stumble over pebbles, not mountains. Never give up!

Posted

The PHP code above doesn't have any newlines. The problem with that is that any in-line comment indicators (//) will comment out the WHOLE line.

 

If you have a backup I'd use that to revert rather than trying to edit what you've posted above. Otherwise, grab the original from the osCommerce pack.

 

When changing your store logo the simplest and most error-free way to do it is to simply rename your image to oscommerce.gif and replace the existing file in the images directory. :)

Posted

Steve

Thank you so much for the quick reply. WOW! What a great suggestion about the oscommerce.gif. That is a perfect solution. Now, all I need to know if how to "grab the orignal from the osCommerce pack." I never had to download the original Dot5hosting had it set up on the server for me to set up, so I have no idea how to go about it. I didn't want to download the entire package for one file, but if that is the only way to do it, I will. Thank you so much for your help.

Sharron

There are many failures on the road to success. We stumble over pebbles, not mountains. Never give up!

Posted

You can grab the pack from here.

 

It's probably not a bad idea to have this default fileset stored somewhere anyway, just incase you need to compare a file to the default or if you need to replace it.

 

All the best. :)

Posted

Steve,

 

You are AWESOME! :D You were kind, patient and extremely helpful. I see that the osCommerce support site is going to be a positive experience. Someday, after I learn PHP and HTML, I can help others who are stuck like I was. Good deeds and random acts of kindness should alway be passed along. I have already downloaded the file and it was painless. Now I am going to attempt to replace the online file. You made my day.

 

Sharron

There are many failures on the road to success. We stumble over pebbles, not mountains. Never give up!

Posted

Thanks for the kind words, Sharon. :blush:

 

It's the balance of the universe. I may well be needing help in the future and it may very well be you providing that help! :D

Posted

Thanks to Steve's great advice, I was able to replace the damaged file and then play with the logo by using the tip he gave me about renaming my logo to ecommerce.gif. That was the best tip every for newbies like me. My store is now linked in my site and working. I still want to make a lot of changes, but it is up and working. Thanks a million Steve.

There are many failures on the road to success. We stumble over pebbles, not mountains. Never give up!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...