acbouquet Posted October 18, 2006 Posted October 18, 2006 I am BRAND NEW to php, and I'm pretty new at OS Commerce - I've fiddled with it for a while, but have never gotten to the point of being able to publish my website. Now, I'm ready to take the leap and I'm stuck in first gear! I'm trying to change the Index page and get the following error: Parse error: syntax error, unexpected T_STRING in /home/courdyj/public_html/includes/languages/english.php on line 13 I've changed my code dozens of different ways (trial & error), but the error never changes. Can someone help me figure out what I'm doing wrong? Thanks! <?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 */ <td class="main">Welcome <span class="greetUser">Guest!</span> Would you like to <a href="https://candybouquetdirectory.com/login.php"><u>log yourself in</u></a>? Or would you prefer to <a href="https://candybouquetdirectory.com/create_account.php"><u>create an account</u></a>?</td> </tr> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> <tr> define('TEXT_INFORMATION', ' Welcome to Your Candy Bouquet Directory!< br><br>This website has been designed to help you find candy bouquets and candy gifts or baskets near you, near your client & customers, or near the loved ones you wish AC Bouquet Candy Bouquets and Gift Baskets: 100's of candy bouquets, cookie bouquets, and gift baskets for all occasions, tastes and budgets! - It's my work-in-progress! Any suggestions are greatly appreciated!
bostonbean Posted October 18, 2006 Posted October 18, 2006 I noticed you are using an "&"... maybe try escaping it? "/&"
acbouquet Posted October 18, 2006 Author Posted October 18, 2006 Thank you so much for your quick reply! It has done a tremendous job for my sanity. But, I don't know whether to shout for joy or cry....at least the error has changed ;) Now I'm told the following: Parse error: syntax error, unexpected '<' in /home/courdyj/public_html/includes/languages/english.php on line 12 Any suggestions? AC Bouquet Candy Bouquets and Gift Baskets: 100's of candy bouquets, cookie bouquets, and gift baskets for all occasions, tastes and budgets! - It's my work-in-progress! Any suggestions are greatly appreciated!
digbydo Posted October 18, 2006 Posted October 18, 2006 have you finished the line off correctly? or near the loved ones you wish '); it's not shown in your code... one-click installation.. Dave's info
acbouquet Posted October 18, 2006 Author Posted October 18, 2006 The segment looks as follows: define('TEXT_INFORMATION', ' Welcome to Your Candy Bouquet Directory!< br><br>This website has been designed to help you find candy bouquets and candy gifts or baskets near you, near your client /& customers, or near the loved ones you wish to send gifts to. <BR><BR>By using <b>Your Candy Bouquet Directory</b> you will be able to save on shipping times, and shipping costs for your candy bouquets because you can find a candy bouquet company that is located closer to the delivery destination!<BR><BR>Please enjoy our candy bouquet directory and feel free to check out all the pages, or ask us questions! If you are looking for something specific, but can\'t find it, please don\'t hesitate to contact us at [email protected] and we\'d be happy to help you out ?);< Does that look right? AC Bouquet Candy Bouquets and Gift Baskets: 100's of candy bouquets, cookie bouquets, and gift baskets for all occasions, tastes and budgets! - It's my work-in-progress! Any suggestions are greatly appreciated!
Guest Posted October 18, 2006 Posted October 18, 2006 In the segment you've posted above there's a < appearing after the ; Maybe try removing that. :)
acbouquet Posted October 18, 2006 Author Posted October 18, 2006 Bennstein, Thanks for the input. I'm sitting here reading through my "PHP For Dummies" Book and am absolutely amazed at how one single character can throw off the entire page. I have the error on line 12 fixed (I hope!) But have now encountered yet ANOTHER error on line 3 Parse error: syntax error, unexpected '<' in /home/courdyj/public_html/includes/languages/english.php on line 3 Stupid question (I'm sure) - how does the computer number the lines? I've tried to count down each line and find the error that way - but it hasn't seemed to be the case... Maybe I'm more blonde than I thought. Anyway, here is the entire code for the page thus far....Maybe if you can see it from top to bottom you can see where my problem lies? <?php <td class="main">Welcome <span class="greetUser">Guest!</span> Would you like to <a href="https://candybouquetdirectory.com/login.php"><u>log yourself in</u></a>? Or would you prefer to <a href="https://candybouquetdirectory.com/create_account.php"><u>create an account</u></a>?</td> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </td></tr> <tr> define('TEXT_INFORMATION', ' Welcome to Your Candy Bouquet Directory<br><br>This website has been designed to help you find candy bouquets and candy gifts or baskets near you, near your client \& customers, or near the loved ones you wish to send gifts to. <br><br>By using <b>Your Candy Bouquet Directory</b> you will be able to save on shipping times, and shipping costs for your candy bouquets because you can find a candy bouquet company that is located closer to the delivery destination!<br><br>Please enjoy our candy bouquet directory and feel free to check out all the pages, or ask us questions! If you are looking for something specific, but can\'t find it, please don\'t hesitate to contact us and we\'d be happy to help you out ?);<font color="#f0000"></font> </tr> 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'); } ?> And I'll keep reading my "PHP for Dummies" until I can figure out what I'm doing! Thanks so much for your help! I really appreciate you taking time out to help such a newbie! AC Bouquet Candy Bouquets and Gift Baskets: 100's of candy bouquets, cookie bouquets, and gift baskets for all occasions, tastes and budgets! - It's my work-in-progress! Any suggestions are greatly appreciated!
Guest Posted October 18, 2006 Posted October 18, 2006 Hi Susan, Try moving the <?php to just before the following line: define('TEXT_INFORMATION', ' I think the errors you are getting are because of the html tags within the php tags. Hope this helps. :)
acbouquet Posted October 18, 2006 Author Posted October 18, 2006 Thanks! I did as you suggested and moved the <?php to just before the main text, then I removed all the html formatting and changed it to PHP formatting. Now I get YET another error message.... Parse error: syntax error, unexpected T_STRING in /home/courdyj/public_html/includes/languages/english.php on line 10 I'm getting frustrated here. All I wanted to do was change the main text on the opening page. I haven't made any other modifications. Why is this so difficult? The code now looks as follows: <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </td></tr> <tr> <?php define('TEXT_INFORMATION', ' Welcome to Your Candy Bouquet Directory! \n \n This website has been designed to help you find candy bouquets and candy gifts or baskets near you, near your client \& customers, or near the loved ones you wish to send gifts to. \n\n By using <b>Your Candy Bouquet Directory</b> you will be able to save on shipping times, and shipping costs for your candy bouquets because you can find a candy bouquet company that is located closer to the delivery destination! \n\n Please enjoy our candy bouquet directory and feel free to check out all the pages, or ask us questions! If you are looking for something specific, but can\'t find it, please don\'t hesitate to contact us and we\'d be happy to help you out ?);<font color="#f0000"></font> </tr> 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'); } ?> AC Bouquet Candy Bouquets and Gift Baskets: 100's of candy bouquets, cookie bouquets, and gift baskets for all occasions, tastes and budgets! - It's my work-in-progress! Any suggestions are greatly appreciated!
Guest Posted October 18, 2006 Posted October 18, 2006 Parse error: syntax error, unexpected T_STRING in /home/courdyj/public_html/includes/languages/english.php on line 10 I'm getting frustrated here. All I wanted to do was change the main text on the opening page. I haven't made any other modifications. Why is this so difficult? Firstly, it seems strange that the file is /languages/english.php. My code is contained within /languages/english/index.php. Anyhoo, I think the problems are all coming from html tags in the php block. There are still some remaining (see below) define('TEXT_INFORMATION', ' Welcome to Your Candy Bouquet Directory! \n \n This website has been designed to help you find candy bouquets and candy gifts or baskets near you, near your client \& customers, or near the loved ones you wish to send gifts to. \n\n By using <b>Your Candy Bouquet Directory</b> you will be able to save on shipping times, and shipping costs for your candy bouquets because you can find a candy bouquet company that is located closer to the delivery destination! \n\n Please enjoy our candy bouquet directory and feel free to check out all the pages, or ask us questions! If you are looking for something specific, but can\'t find it, please don\'t hesitate to contact us and we\'d be happy to help you out ?);<font color="#f0000"></font> </tr> If you want those font tags in the text then it must be within ' ' of the define statement (see how above they fall outside of the single quotes, and even outside of the statement terminator (semicolon)? FYI, here is a pretty stock languages/english/index.php: <?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('TEXT_MAIN', 'This is a default setup of the osCommerce project, products shown are for demonstrational purposes, <b>any products purchased will not be delivered nor will the customer be billed</b>. Any information seen on these products is to be treated as fictional.<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Error Messages</b><br><br>If there are any error or warning messages shown above, please correct them first before proceeding.<br><br>Error messages are displayed at the very top of the page with a complete <span class="messageStackError">background</span> color.<br><br>Several checks are performed to ensure a healthy setup of your online store - these checks can be disabled by editing the appropriate parameters at the bottom of the includes/application_top.php file.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be modified in the following file, on each language basis:<br><br><nobr class="messageStackSuccess">[path to catalog]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or via the Administration Tool with the <nobr class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr> or <nobr class="messageStackSuccess">Tools->File Manager</nobr> modules.<br><br>The text is set in the following manner:<br><br><nobr>define(\'TEXT_MAIN\', \'<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>\');</nobr><br><br>The text highlighted in green may be modified - it is important to keep the define() of the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the following example is used where only two single quote characters exist:<br><br><nobr>define(\'TEXT_MAIN\', \'\');</nobr><br><br>More information concerning the PHP define() function can be read <a href="http://www.php.net/define" target="_blank"><u>here</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Securing The Administration Tool</b><br><br>It is important to secure the Administration Tool as there is currently no security implementation available.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main" valign="top"><b>Online Documentation</b><br><br>Online documentation can be read at the <a href="http://www.oscommerce.info" target="_blank"><u>osCommerce Knowledge Base</u></a> site.<br><br>Community support is available at the <a href="http://www.oscommerce.com/forums" target="_blank"><u>osCommerce Community Support Forums</u></a> site.</td></tr></table><br>If you wish to download the solution powering this shop, or if you wish to contribute to the osCommerce project, please visit the <a href="http://www.oscommerce.com" target="_blank"><u>support site of osCommerce</u></a>. This shop is running on osCommerce version <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.'); 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'); } ?> All you should need to do is alter the define('TEXT_MAIN', 'blah blah blah'); statement, and remember to only change the blah blah blah bit, nothing else. :) Good luck. Hope you sort it this time. :)
Recommended Posts
Archived
This topic is now archived and is closed to further replies.