Web Analytics Made Easy -
StatCounter syntax error please help! - CodingForum

Announcement

Collapse
No announcement yet.

syntax error please help!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • syntax error please help!

    i got this error:

    Parse error: syntax error, unexpected ',' in C:\wamp\www\flotech-latesbackup-Copy\shop\includes\boxes\featured.php on line 37


    this is line 37:

    $new_price = $currencies->display_price($random_product['products_price'], ($random_product['products_tax'], ($random_product['currency_id'], tep_get_tax_rate($random_product['products_tax_class_id']))));

  • #2
    PHP Code:
    $new_price $currencies->display_price($random_product['products_price'], $random_product['products_tax'], $random_product['currency_id'], tep_get_tax_rate($random_product['products_tax_class_id'])); 
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog

    Comment


    • #3
      hi thanks for your reply.. i tried your code and its working already. but another error comes in..

      Warning: strpos() [function.strpos]: Empty delimiter. in C:\wamp\www\flotech-latesbackup-Copy\shop\index.php on line 386


      this is the line 386 in index.php:

      PHP Code:
      <?php
          
      if (isset($cPath) && strpos('_'$cPath)) {
      // check to see if there are deeper categories within the current category
            
      $category_links array_reverse($cPath_array);
            for(
      $i=0$n=sizeof($category_links); $i<$n$i++) {
              
      $categories_query tep_db_query("select count(*) as total from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "'");
              
      $categories tep_db_fetch_array($categories_query);
              if (
      $categories['total'] < 1) {
                
      // do nothing, go through the loop
              
      } else {
                
      $categories_query tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "' order by sort_order, cd.categories_name");
                break; 
      // we've found the deepest category the customer is in
              
      }
            }
          } else {
            
      $categories_query tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " TABLE_CATEGORIES " c, " TABLE_CATEGORIES_DESCRIPTION " cd where c.parent_id = '" . (int)$current_category_id "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id "' order by sort_order, cd.categories_name");
          }

          
      $number_of_categories tep_db_num_rows($categories_query);

          
      $rows 0;
          while (
      $categories tep_db_fetch_array($categories_query)) {
            
      $rows++;
            
      $cPath_new tep_get_path($categories['categories_id']);
            
      //$width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';
                  
      $width '225';
                  if(
      tep_not_null($categories['categories_image'])) {
                echo 
      '                <td align="center" class="main" width="' $width '" height="100"><a href="' tep_href_link(FILENAME_DEFAULT$cPath_new) . '">' tep_image(DIR_WS_IMAGES $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTHSUBCATEGORY_IMAGE_HEIGHT) . '<br><strong>&raquo;&nbsp;' $categories['categories_name'] . '</strong></a></div></td>' "\n";
                  } else {
                echo 
      '                <td align="left" valign="middle" class="main" width="' $width '" height="50"><div class="jamesbox"><a href="' tep_href_link(FILENAME_DEFAULT$cPath_new) . '"><strong>&raquo;&nbsp;' $categories['categories_name'] . '</strong></a></td>' "\n";
                  }
            if (((
      $rows MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
              echo 
      '              </tr>' "\n";
              echo 
      '              <tr>' "\n";
            }
          }

      // needed for the new products module shown below
          
      $new_products_category_id $current_category_id;
      ?>

      Comment


      • #4
        You should replace
        PHP Code:
        strpos('_'$cPath
        with
        PHP Code:
        strpos($cPath'_'
        Note that strpos may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or "". I would write
        PHP Code:
        if (!empty($cPath) && strpos($cPath'_') !== false

        Comment

        Working...
        X