I have this error on my site could help me please

Parse error: syntax error, unexpected T_STRING in / home / healthho / public_html / osCommerce / advanced_search_result.php on line 214

This information is on line 214

$ from_str = "from ((". TABLE_PRODUCTS. "p) left join". TABLE_MANUFACTURERS. "m using (manufacturers_id),". TABLE_PRODUCTS_DESCRIPTION. "pd) left join". TABLE_SPECIALS. "S on p.products_id = s.products_id,". TABLE_CATEGORIES. "C,". TABLE_PRODUCTS_TO_CATEGORIES. "P2C";

Thank you very much for the first time that I occupy this forum and hope to be doing well

    First problem I notice is the space between the dollar sign and the name of the variable.

      Sorry, apparently hit the wrong code, because there are no spaces between these two characters need to replace it or take a picture you thank you very much for your help

      $from_str = “from ((” . TABLE_PRODUCTS . ” p) left join ” . TABLE_MANUFACTURERS . ” m using(manufacturers_id), ” . TABLE_PRODUCTS_DESCRIPTION . ” pd) left join ” . TABLE_SPECIALS . ” s on p.products_id = s.products_id, ” . TABLE_CATEGORIES . ” c, ” . TABLE_PRODUCTS_TO_CATEGORIES . ” p2c”;

        Does your code really have smart quotes instead of regular quotes (which PHP would NOT recognize as string delimiters)? ALSO note that your string will not form properly as it will not have any spaces around the constants you are using when interpolated.

          I am a graphic designer and programming little research I did this page could be more specific where this error thank you very much

            5 days later

            I put the code, thank you very much for your help

            <?php
            /*
              $Id: advanced_search_result.php,v 1.72 2003/06/23 06:50:11 project3000 Exp $
            
              osCommerce, Open Source E-Commerce Solutions
              [url]http://www.oscommerce.com[/url]
            
              Copyright (c) 2003 osCommerce
            
              Released under the GNU General Public License
            */
            
              require('includes/application_top.php');
            
              require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);
            
              $error = false;
            
              if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) &&
                   (isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) &&
                   (isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) &&
                   (isset($HTTP_GET_VARS['pfrom']) && !is_numeric($HTTP_GET_VARS['pfrom'])) &&
                   (isset($HTTP_GET_VARS['pto']) && !is_numeric($HTTP_GET_VARS['pto'])) ) {
                $error = true;
            
            $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
              } else {
                $dfrom = '';
                $dto = '';
                $pfrom = '';
                $pto = '';
                $keywords = '';
            
            if (isset($HTTP_GET_VARS['dfrom'])) {
              $dfrom = (($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dfrom']);
            }
            
            if (isset($HTTP_GET_VARS['dto'])) {
              $dto = (($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dto']);
            }
            
            if (isset($HTTP_GET_VARS['pfrom'])) {
              $pfrom = $HTTP_GET_VARS['pfrom'];
            }
            
            if (isset($HTTP_GET_VARS['pto'])) {
              $pto = $HTTP_GET_VARS['pto'];
            }
            
            if (isset($HTTP_GET_VARS['keywords'])) {
              $keywords = $HTTP_GET_VARS['keywords'];
            }
            
            $date_check_error = false;
            if (tep_not_null($dfrom)) {
              if (!tep_checkdate($dfrom, DOB_FORMAT_STRING, $dfrom_array)) {
                $error = true;
                $date_check_error = true;
            
                $messageStack->add_session('search', ERROR_INVALID_FROM_DATE);
              }
            }
            
            if (tep_not_null($dto)) {
              if (!tep_checkdate($dto, DOB_FORMAT_STRING, $dto_array)) {
                $error = true;
                $date_check_error = true;
            
                $messageStack->add_session('search', ERROR_INVALID_TO_DATE);
              }
            }
            
            if (($date_check_error == false) && tep_not_null($dfrom) && tep_not_null($dto)) {
              if (mktime(0, 0, 0, $dfrom_array[1], $dfrom_array[2], $dfrom_array[0]) > mktime(0, 0, 0, $dto_array[1], $dto_array[2], $dto_array[0])) {
                $error = true;
            
                $messageStack->add_session('search', ERROR_TO_DATE_LESS_THAN_FROM_DATE);
              }
            }
            
            $price_check_error = false;
            if (tep_not_null($pfrom)) {
              if (!settype($pfrom, 'double')) {
                $error = true;
                $price_check_error = true;
            
                $messageStack->add_session('search', ERROR_PRICE_FROM_MUST_BE_NUM);
              }
            }
            
            if (tep_not_null($pto)) {
              if (!settype($pto, 'double')) {
                $error = true;
                $price_check_error = true;
            
                $messageStack->add_session('search', ERROR_PRICE_TO_MUST_BE_NUM);
              }
            }
            
            if (($price_check_error == false) && is_float($pfrom) && is_float($pto)) {
              if ($pfrom >= $pto) {
                $error = true;
            
                $messageStack->add_session('search', ERROR_PRICE_TO_LESS_THAN_PRICE_FROM);
              }
            }
            
            if (tep_not_null($keywords)) {
              if (!tep_parse_search_string($keywords, $search_keywords)) {
                $error = true;
            
                $messageStack->add_session('search', ERROR_INVALID_KEYWORDS);
              }
            }
              }
            
              if (empty($dfrom) && empty($dto) && empty($pfrom) && empty($pto) && empty($keywords)) {
                $error = true;
            
            $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
              }
            
              if ($error == true) {
                tep_redirect(tep_href_link(FILENAME_ADVANCED_SEARCH, tep_get_all_get_params(), 'NONSSL', true, false));
              }
            
              $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));
              $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, tep_get_all_get_params(), 'NONSSL', true, false));
            ?>
            <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
            <html <?php echo HTML_PARAMS; ?>>
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
            <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
            <title><?php echo TITLE; ?></title>
            <link rel="stylesheet" type="text/css" href="stylesheet.css">
            </head>
            <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
            <!-- header //-->
            <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
            <!-- header_eof //-->
            
            <!-- body //-->
            <table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td bgcolor="#FFFFFF" width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">
            <!-- left_navigation //-->
            <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
            <!-- left_navigation_eof 
                </table></td>
            <!-- body_text //-->
                <td width="100%" valign="top" bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="0"><tr><td class="headerNavigation"><?php echo $breadcrumb->trail(' &raquo; ');?></td>
                </tr></table><table border="0" width="486" cellspacing="3" cellpadding="3">
                  <tr>
                    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
                      <tr>
                        <td class="pageHeading"><?php echo HEADING_TITLE_2; ?></td>
                            <td class="pageHeading" align="right">&nbsp;</td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
                  </tr>
                  <tr>
                    <td>
            <?php
            // create column list
              $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
                                   'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
                                   'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
                                   'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
                                   'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
                                   'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
                                   'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
                                   'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);
            
              asort($define_list);
            
              $column_list = array();
              reset($define_list);
              while (list($key, $value) = each($define_list)) {
                if ($value > 0) $column_list[] = $key;
              }
            
              $select_column_list = '';
            
              for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
                switch ($column_list[$i]) {
                  case 'PRODUCT_LIST_MODEL':
                    $select_column_list .= 'p.products_model, ';
                    break;
                  case 'PRODUCT_LIST_MANUFACTURER':
                    $select_column_list .= 'm.manufacturers_name, ';
                    break;
                  case 'PRODUCT_LIST_QUANTITY':
                    $select_column_list .= 'p.products_quantity, ';
                    break;
                  case 'PRODUCT_LIST_IMAGE':
                    $select_column_list .= 'p.products_image, ';
                    break;
                  case 'PRODUCT_LIST_WEIGHT':
                    $select_column_list .= 'p.products_weight, ';
                    break;
                }
              }
            
              $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";
            
              if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
                $select_str .= ", SUM(tr.tax_rate) as tax_rate ";
              }
            
             $from_str = “from ((” . TABLE_PRODUCTS . ” p) left join ” . TABLE_MANUFACTURERS . ” m using(manufacturers_id), ” . TABLE_PRODUCTS_DESCRIPTION . ” pd) left join ” . TABLE_SPECIALS . ” s on p.products_id = s.products_id, ” . TABLE_CATEGORIES . ” c, ” . TABLE_PRODUCTS_TO_CATEGORIES . ” p2c”;
            
              if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
                if (!tep_session_is_registered('customer_country_id')) {
                  $customer_country_id = STORE_COUNTRY;
                  $customer_zone_id = STORE_ZONE;
                }
                $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
              }

              As Derokorian said, &#8220;these quotes&#8221; aren't recognised by PHP as delimiting strings. You'll notice from the code you posted that on the line where you're having trouble the strings aren't the same colour as the other strings in the script. You need straight "double quotes".

                Write a Reply...