randallc Posted July 19, 2009 Share Posted July 19, 2009 PLEASe HELP... business is at a stand still because of a parse error. I am getting an error Parse error: syntax error, unexpected '{'in /home/sugarlan/public_html/includes/languages/english/index.php on line 18 index.php lines 1-25 <?php /* $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $cateqories_products = tep_db_fetch_array($categories_products_query); if ($cateqories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/ Share on other sites More sharing options...
.josh Posted July 19, 2009 Share Posted July 19, 2009 Nothing wrong syntactically wrong with that. Look in application_top.php Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/#findComment-878159 Share on other sites More sharing options...
randallc Posted July 19, 2009 Author Share Posted July 19, 2009 Sorry I posted the wrong index.php... the problem is still on line 18 in the following: <?php /* $Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s'); define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products'); define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected'); if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id']) ) { define('HEADING_TITLE', 'Let's See What We Have Here'); define('TABLE_HEADING_IMAGE', ''); define('TABLE_HEADING_MODEL', 'Model'); define('TABLE_HEADING_PRODUCTS', 'Product Name'); define('TABLE_HEADING_MANUFACTURER', 'Manufacturer'); define('TABLE_HEADING_QUANTITY', 'Quantity'); define('TABLE_HEADING_PRICE', 'Price'); define('TABLE_HEADING_WEIGHT', 'Weight'); define('TABLE_HEADING_BUY_NOW', 'Buy Now'); define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.'); define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.'); define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: '); define('TEXT_SHOW', '<b>Show:</b>'); define('TEXT_BUY', 'Buy 1 ''); define('TEXT_NOW', '' now'); define('TEXT_ALL_CATEGORIES', 'All Categories'); define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers'); } elseif ($category_depth == 'top') { define('HEADING_TITLE', 'Your Slogan Here!!'); } elseif ($category_depth == 'nested') { define('HEADING_TITLE', 'Categories'); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/#findComment-878280 Share on other sites More sharing options...
.josh Posted July 19, 2009 Share Posted July 19, 2009 if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id']) ) { you are missing a closing ) Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/#findComment-878285 Share on other sites More sharing options...
randallc Posted July 20, 2009 Author Share Posted July 20, 2009 Now Im getting a different error. Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/sugarlan/public_html/includes/languages/english/index.php on line 34 I changed line 18 already <?php /* $Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s'); define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products'); define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected'); if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id']) )); { define('HEADING_TITLE', 'Lets See What We Have Here'); define('TABLE_HEADING_IMAGE', ''); define('TABLE_HEADING_MODEL', 'Model'); define('TABLE_HEADING_PRODUCTS', 'Product Name'); define('TABLE_HEADING_MANUFACTURER', 'Manufacturer'); define('TABLE_HEADING_QUANTITY', 'Quantity'); define('TABLE_HEADING_PRICE', 'Price'); define('TABLE_HEADING_WEIGHT', 'Weight'); define('TABLE_HEADING_BUY_NOW', 'Buy Now'); define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.'); define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.'); define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: '); define('TEXT_SHOW', '<b>Show:</b>'); define('TEXT_BUY', 'Buy 1 ''); define('TEXT_NOW', ' now'); define('TEXT_ALL_CATEGORIES', 'All Categories'); define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers'); } elseif ($category_depth == 'top') { define('HEADING_TITLE', 'Your Slogan Here!!'); } elseif ($category_depth == 'nested') { define('HEADING_TITLE', 'Categories'); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/#findComment-878382 Share on other sites More sharing options...
Coreye Posted July 20, 2009 Share Posted July 20, 2009 define('TEXT_BUY', 'Buy 1 ''); You ended it with two ''. Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/#findComment-878383 Share on other sites More sharing options...
randallc Posted July 20, 2009 Author Share Posted July 20, 2009 That did not work. Would anybody care to edit my index.php file directly in my cpanel. If you have a paypal account I could even shoot you a few dollars. But I need it done yesterday. Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/#findComment-878396 Share on other sites More sharing options...
Coreye Posted July 20, 2009 Share Posted July 20, 2009 That did not work. Would anybody care to edit my index.php file directly in my cpanel. If you have a paypal account I could even shoot you a few dollars. But I need it done yesterday. Are you getting the same error? Try this: <?php /* $Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s'); define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products'); define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected'); if(($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id']))) { define('HEADING_TITLE', 'Lets See What We Have Here'); define('TABLE_HEADING_IMAGE', ''); define('TABLE_HEADING_MODEL', 'Model'); define('TABLE_HEADING_PRODUCTS', 'Product Name'); define('TABLE_HEADING_MANUFACTURER', 'Manufacturer'); define('TABLE_HEADING_QUANTITY', 'Quantity'); define('TABLE_HEADING_PRICE', 'Price'); define('TABLE_HEADING_WEIGHT', 'Weight'); define('TABLE_HEADING_BUY_NOW', 'Buy Now'); define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.'); define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.'); define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: '); define('TEXT_SHOW', '<strong>Show:</strong>'); define('TEXT_BUY', 'Buy 1'); define('TEXT_NOW', ' now'); define('TEXT_ALL_CATEGORIES', 'All Categories'); define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers'); } elseif ($category_depth == 'top') { define('HEADING_TITLE', 'Your Slogan Here!!'); } elseif ($category_depth == 'nested') { define('HEADING_TITLE', 'Categories'); } ?> If that doesn't work, contact me on one of my messengers or PM the details and I'll fix it. Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/#findComment-878398 Share on other sites More sharing options...
randallc Posted July 20, 2009 Author Share Posted July 20, 2009 It worked... it worked... thank God it worked. Quote Link to comment https://forums.phpfreaks.com/topic/166521-solved-parse-error-syntax-error-unexpected/#findComment-878408 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.