PHP Fehler

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • PHP Fehler

    Hallo,

    ich komme einfach nicht mehr weiter. Wer kann helfen. Es handelt sich um eine Fehlermeldung die ich nicht wegbekomme

    Parse error: syntax error, unexpected T_ELSE in /var/www/---/html/----/---/datei.php on line 922

    Habe mal hier den Ausschnitt mit der betreffenden Zeile vielleicht kann jemand mal schauen.


    PHP-Code:
    <?php
      
    } elseif ($action == 'new_product_preview') {
        if (
    tep_not_null($HTTP_POST_VARS)) {
          
    $pInfo = new objectInfo($HTTP_POST_VARS);
          
    $products_name $HTTP_POST_VARS['products_name'];
          
    $products_description $HTTP_POST_VARS['products_description'];
          
    $products_head_title_tag $HTTP_POST_VARS['products_head_title_tag'];
          
    $products_head_desc_tag $HTTP_POST_VARS['products_head_desc_tag'];
          
    $products_head_keywords_tag $HTTP_POST_VARS['products_head_keywords_tag'];
          
    $products_url $HTTP_POST_VARS['products_url'];
        } else {
          
    $product_query tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
          
    $product tep_db_fetch_array($product_query); 
          
             

          
    $products_image tep_get_uploaded_file('products_image');
          
    $image_directory tep_get_local_path(DIR_FS_CATALOG_IMAGES);

          if (
    is_uploaded_file($products_image['tmp_name'])) {
            
    tep_copy_uploaded_file($products_image$image_directory);
            
    $products_image_name $products_image['name'];
          } else {
          
    $products_image_name $HTTP_POST_VARS['products_previous_image'];
          }



        } else {   
    Zeile 922
            



          $product_query 
    tep_db_query("select p.products_tax_class_id, p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd where p.products_id = pd.products_id and p.products_id = '" $HTTP_GET_VARS['pID'] . "'");

          
    $product tep_db_fetch_array($product_query);

          
    $pInfo = new objectInfo($product);
          
    $products_image_name $pInfo->products_image;
        }

        
    $form_action = ($HTTP_GET_VARS['pID']) ? 'update_product' 'insert_product';

        echo 
    tep_draw_form($form_actionFILENAME_CATEGORIES'cPath=' $cPath '&pID=' $HTTP_GET_VARS['pID'] . '&action=' $form_action'post''enctype="multipart/form-data"');

       
    $languages tep_get_languages();
        for (
    $i=0$n=sizeof($languages); $i<$n$i++) {
          if (isset(
    $HTTP_GET_VARS['read']) && ($HTTP_GET_VARS['read'] == 'only')) {
            
    $pInfo->products_name tep_get_products_name($pInfo->products_id$languages[$i]['id']);
            
    $pInfo->products_description tep_get_products_description($pInfo->products_id$languages[$i]['id']);
            
    $pInfo->products_head_title_tag tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);
            
    $pInfo->products_head_desc_tag tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);
            
    $pInfo->products_head_keywords_tag tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);
            
    $pInfo->products_url tep_get_products_url($pInfo->products_id$languages[$i]['id']);
          } else {
            
    $pInfo->products_name tep_db_prepare_input($products_name[$languages[$i]['id']]);
            
    $pInfo->products_description tep_db_prepare_input($products_description[$languages[$i]['id']]);
            
    $pInfo->products_head_title_tag tep_db_prepare_input($products_head_title_tag[$languages[$i]['id']]);
            
    $pInfo->products_head_desc_tag tep_db_prepare_input($products_head_desc_tag[$languages[$i]['id']]);
            
    $pInfo->products_head_keywords_tag tep_db_prepare_input($products_head_keywords_tag[$languages[$i]['id']]);
            
    $pInfo->products_url tep_db_prepare_input($products_url[$languages[$i]['id']]);
          }  
    ?>

  • #2
    Bitte lies unsere Regeln und befolge sie - insbesondere den Teil über das Umbrechen von Code!

    Dein Fehler: Ein If-Else kann immer nur genau ein else haben. Deins hat zwei. Das zweite ist das in Zeile 922. Da du den Code eigentlich schön eingerückt hast, hättest du das selbst sehen sollen.

    Kommentar


    • #3
      Danke für die schnelle Hilfe es funzt - else entfernt. Sehe selber jetzt das es ein bisschen breit geworden ist der Beitrag.

      Kommentar


      • #4
        HTTP_POST_VARS ist unheimlich veraltet, du solltest $_POST verwenden.

        Kommentar

        Lädt...
        X