Forum Moderators: coopster

Message Too Old, No Replies

Learning PHP - Flummoxed by error

         

BeckyG

2:26 am on Nov 22, 2008 (gmt 0)

10+ Year Member



I am working on an OSCommerce website and trying to learn PHP as I go along. I'm currently flummoxed by an error message that I can't find the cause of. I'm sure it must be a missing period or comma somewhere but I'm going blind trying to find it. Can someone look at this and see what it could be? The error goes like this:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/www/greenlife/example.com/docs/shop/index.php on line 13

Line 13 is the first define line, right under <?php

The words 'test text' are mine - I deleted all the demo text that was in there.

*/
<?php
define('TEXT_MAIN', 'Test Text');
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', 'What\'s New Here?');
} elseif ($category_depth == 'nested') {
define('HEADING_TITLE', 'Categories');
}
?>

[edited by: dreamcatcher at 7:21 am (utc) on Nov. 22, 2008]
[edit reason] Exemplified domain. [/edit]

Anyango

2:53 am on Nov 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld BeckyG!

Please paste line 12 as well. as these errors usually are from a line above the reported one.

BeckyG

3:19 am on Nov 22, 2008 (gmt 0)

10+ Year Member



Actually, that is the 1st line, the <?php line is first, of course. There is nothing before that.

BeckyG

9:01 pm on Nov 22, 2008 (gmt 0)

10+ Year Member



Ok, I added the test at the top in case that is anything, but I don't think it is. Here goes:

<?php
/*
$Id: index.php 1739 2007-12-20 00:52:16Z hpdl $

osCommerce, Open Source E-Commerce Solutions
[oscommerce.com...]

Copyright (c) 2007 osCommerce

Released under the GNU General Public License
*/

define('TEXT_MAIN', 'Test Text');
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', 'What\'s New Here?');
} elseif ($category_depth == 'nested') {
define('HEADING_TITLE', 'Categories');
}
?>

Anyango

9:37 pm on Nov 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is this file included in any other file ? because the error is not there in the code lines that you 've pasted. I just copied em and put in a file to see and there is no error and they are fine. It could be some include file that has the error actually

BeckyG

12:43 am on Nov 23, 2008 (gmt 0)

10+ Year Member



Oh, that's helpful to know. This is the index.php file and is, of course, nested in several other files. I'll do more checking. Thanks.