• Home
  • Forum
  • Fare Web
  • PHP

Confrontare prodotti

  • Creatore Discussione Creatore Discussione reeda80
  • Data di inizio Data di inizio 2 Feb 2010
  • Tag Tag
    array
Prec.
  • 1
  • 2
Primo Prec. 2 di 2

alessandro1997

Utente Attivo
6 Ott 2009
5.302
1
0
27
Roma
alessandro1997.netsons.org
  • 5 Feb 2010
  • #21
Ma il mio codice funziona?
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 5 Feb 2010
  • #22
Ciao Alessandro,
a video mi restituisce i checkbox ma se metto il controllo var_dump($_POST['products[]']); mi restituisce un tristissimo NULL.... stessa cosa se provo a spuntare i campi e a mandarli con il button(Ma qui sicuramente è un errore nel button!) nella pagina 3... eccolo di nuovo! NULL... non so proprio perchè! ...
 
Ultima modifica: 5 Feb 2010
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 5 Feb 2010
  • #23
O sbaglio a fare il controllo anche qui e non serve?:byebye:
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 5 Feb 2010
  • #24
La cosa strana è che fino a ieri a video non mi mostrava neanche i checkbox... oggi sì! Sono pazza io o è pazzo il php?
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 5 Feb 2010
  • #25
Oddio mi rispondo sola, il controllo dove si trovano i checkbox non spuntati non serve a nulla... il problema potrebbe essere quindi appunto nell'invio dei dati stessi, ovvero come li prelevo... nel senso appunto del button...
 

alessandro1997

Utente Attivo
6 Ott 2009
5.302
1
0
27
Roma
alessandro1997.netsons.org
  • 5 Feb 2010
  • #26
Il campo non lo devi richiamare con $_POST['products[]'] ma con $_POST['products'], anche se nel nome del campo ci sono le parentesi quadre
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 8 Feb 2010
  • #27
Ciao Alessandro,
allora ho tolto le parentesi quadre e ho capito che il problema probabilmente è proprio nel button "Invia" perchè... avevo sbagliato e avevo scritto così:
PHP:
<!--Button Confronta-->
<div id="confrontabutton" class="submit"  ><?php 
echo "<a href=\"http://www.miosito/index.php?main_page=page_3&action=". $_POST."\">" . zen_image_button(BUTTON_IMAGE_CONFRONTA) . "</a>"; ?></div>
<br class="clearBoth"/>
<!--Fine Button Confronta-->
questo codice mi restituisce questo: ovvero preleva il nome array e basta... giusto?
PHP:
http://www.miosito/index.php?main_page=page_3&action=Array
Mentre così:
PHP:
<!--Button Confronta-->
<div id="confrontabutton" class="submit"  ><?php 
echo "<a href=\"http://www.miosito/index.php?main_page=page_3&action=". $_POST['products']."\">" . zen_image_button(BUTTON_IMAGE_CONFRONTA) . "</a>"; ?></div>
<br class="clearBoth"/>
<!--Fine Button Confronta-->
Mi restituisce questo... ovvero non preleva nulla!
PHP:
http://www.miosito/index.php?main_page=page_3&action=
Cosa sbaglio? manca qualche istruzione o è proprio concepita male!
Grazie mille e buon inizio di settimana!
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 8 Feb 2010
  • #28
Ah un altro problema dipser
così:
PHP:
<?php
$array = $products_all->fields['products_id'];
foreach($array as $id){
  echo '<input type="checkbox" name="products[]" value="'. $id .'">';}
?>
non mi restituisce nulla a video!

Aiutooooooooooooooo la disperazione avanza!
:byebye:
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 8 Feb 2010
  • #29
Ok così va! nel senso che mi mostra il checkbox a video!
è corretto?
PHP:
<?php
$array = $products_all->fields['products_id'];
foreach($array as $id); {
$prova= '<input type="checkbox" name="products[]" value="'. $id .'">';
echo $prova;?>
	<?php
  }
?>

Mille grazie per tutto!
:byebye:
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 8 Feb 2010
  • #30
Ho notato un'altra cosa strana.... se metto un semplice submit, avendo anche uno spazio per l'aggiunta nel carrello del prodotto mi rimanda, mettendo la quantità alla pagia del carrello nella quale mi inserisce il prodotto non è che entrano in conflitto?
Posto il codice dov'è il form, la parte dove c'è l'altro submit
PHP:
// more info in place of buy now
      if (PRODUCT_ALL_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y') {
        if (zen_has_product_attributes($products_all->fields['products_id'])) {
          $link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . '<br>'. MORE_INFO_TEXT . '</a>';
        } else {
//          $link= '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
          if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0 && $products_all->fields['products_qty_box_status'] != 0) {
//            $how_many++;
            $link = TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_all->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
          } else {
            $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
          }
        }

        $the_button = $link;
        $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . '<br>'. MORE_INFO_TEXT . '</a>';
        $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
      } else {
	        $link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' .  MORE_INFO_TEXT . '</a>';
        $the_button = $link;
        $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' .  MORE_INFO_TEXT . '</a>';
        $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
		
      }
e dove viene visualizzato:
PHP:
	   <td id="buy_now">
      <?php	 if (PRODUCT_ALL_BUY_NOW > '0') { 
                echo $display_products_button;
              ?>
</td>
	<?php } ?>
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 8 Feb 2010
  • #31
:dipser:
:quote:
:byebye:
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 8 Feb 2010
  • #32
Ok! Un passo avanti!
ho messo questo codice:
PHP:
<form name="products" action="index.php?main_page=page_3" method="POST" >

<?php
$array = $products_all->fields['products_id'];
foreach($array as $id); {
$prova= '<input type="checkbox" name="products[]" value="'. $id. '">';
echo $prova;
?>

	<?php
  }
?>
<input type=submit value=Select>
</form>

e nella pagina del confronto:
PHP:
<?php 
$nome_var = $_POST['products'];



if( is_array($nome_var) )

{

   echo "Elementi selezionati: ".count($nome_var)."<br/>";

   echo $nome_var;

   while( $elemento = next($nome_var) ) echo "-> $elemento <br/>";

}
else{
echo 'NCS';
}
?>

Ma mi restituisce:
Elementi selezionati: 1
Array ...

Altro nel primo dei miei prodotti la select mi rimanda al carrello.... rischio la follia

Grazie ancora e buona serata!
:byebye:
 

alessandro1997

Utente Attivo
6 Ott 2009
5.302
1
0
27
Roma
alessandro1997.netsons.org
  • 8 Feb 2010
  • #33
Correggi così:
PHP:
<?php 
$nome_var = $_POST['products'];



if( is_array($nome_var) )

{

   echo "Elementi selezionati: ".count($nome_var)."<br/>";
   
   foreach($nome_var as $nome)
     echo $nome .'<br />';

   while( $elemento = next($nome_var) ) echo "-> $elemento <br/>";

}
else{
echo 'NCS';
}
?>
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 9 Feb 2010
  • #34
Ciao di nuovo... giuro l'ultima cosa! che ora va e mi preleva il products id ma quando cerco di spostare il button di select e di metterlo i modo che appaia una sola volta in fondo per far sì che prelevi più products id, non va! mi rimanda alla pagina del carrello .... perdonatemi ancora... giuro poi non chiedo più nulla e comunque volevo ringraziarti tantissimo per l'aiuto datomi finora!
Thanks!
PHP:
<?php
  if ($products_all_split->number_of_rows > 0) {
    $products_all = $db->Execute($products_all_split->sql_query);
    $row_counter = 0;
    while (!$products_all->EOF) {
      $row_counter++;

      if (PRODUCT_ALL_LIST_IMAGE != '0') {
        if ($products_all->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
          $display_products_image = str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
        } else {
          $display_products_image = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $products_all->fields['products_image'], $products_all->fields['products_name'], IMAGE_PRODUCT_ALL_LISTING_WIDTH, IMAGE_PRODUCT_ALL_LISTING_HEIGHT) . '</a>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_IMAGE, 3, 1));
        }
      } else {
        $display_products_image = '';
      }
      if (PRODUCT_ALL_LIST_NAME != '0') {
        $display_products_name = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '"><strong>' . $products_all->fields['products_name'] . '</strong></a>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_NAME, 3, 1));
      } else {
        $display_products_name = '';
      }
//Codice fornitore
      if (PRODUCT_ALL_LIST_MODEL != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'model')) {
        $display_products_model = $products_all->fields['products_model'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_MODEL, 3, 1));
      } else {
        $display_products_model = '';
      }
	  
//Codice Produzione	  
	  	        if ($products_all->fields['products_id']) {
        $display_products_produzione = $products_all->fields['products_produzione'] . str_repeat('<br clear="all" />');
      } else {
        $display_products_produzione = '';
      }
	  
	  
//Prezzo al dettaglio (Solo per grossisti)
	  	        if ($products_all->fields['products_id']) {
        $display_products_prezzo = $products_all->fields['products_price'] . str_repeat('<br clear="all" />');
      } else {
        $display_products_prezzo = '';
      }

//Ricarico e margine	  
if ($products_all->fields['products_id']) {	
$display_products_prezzo_dettaglio = $products_all->fields['products_price'] ;
$products_price = zen_get_products_display_price($products_all->fields['products_id']);
$display_products_prezzo_ingrosso =  $products_price . (zen_get_show_product_switch($products_all->fields['products_id']));
$perc=100;
$A = $display_products_prezzo_dettaglio-$display_products_prezzo_ingrosso;
$B= $A/$display_products_prezzo_dettaglio;
$MC= $B*100;

$C= $A/$display_products_prezzo_ingrosso;
$MU=$C*100;
}


      if (PRODUCT_ALL_LIST_WEIGHT != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'weight')) {
        $display_products_weight = $products_all->fields['products_weight'] . TEXT_SHIPPING_WEIGHT . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_WEIGHT, 3, 1));
      } else {
        $display_products_weight = '';
      }

      if (PRODUCT_ALL_LIST_QUANTITY != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'quantity')) {
        if ($products_all->fields['products_quantity'] <= 0) {
          $display_products_quantity = TEXT_OUT_OF_STOCK . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_QUANTITY, 3, 1));
        } else {
          $display_products_quantity = $products_all->fields['products_quantity'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_QUANTITY, 3, 1));
        }
      } else {
        $display_products_quantity = '';
      }

      if (PRODUCT_ALL_LIST_DATE_ADDED != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'date_added')) {
        $display_products_date_added = TEXT_DATE_ADDED . ' ' . zen_date_long($products_all->fields['products_date_added']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_DATE_ADDED, 3, 1));
      } else {
        $display_products_date_added = '';
      }

      if (PRODUCT_ALL_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'manufacturer')) {
        $display_products_manufacturers_name = ($products_all->fields['manufacturers_name'] != '' ?  ' ' . $products_all->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_MANUFACTURER, 3, 1)) : '');
      } else {
        $display_products_manufacturers_name = '';
      }

      if ((PRODUCT_ALL_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y') and zen_check_show_prices() == true) {
        $products_price = zen_get_products_display_price($products_all->fields['products_id']);
        $display_products_price = ' ' . $products_price . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($products_all->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($products_all->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
      } else {
        $display_products_price = '';
      }

// more info in place of buy now
      if (PRODUCT_ALL_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($products_all->fields['products_id']) == 'Y') {
        if (zen_has_product_attributes($products_all->fields['products_id'])) {
          $link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . '<br>'. MORE_INFO_TEXT . '</a>';
        } else {
//          $link= '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
          if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0 && $products_all->fields['products_qty_box_status'] != 0) {
//            $how_many++;
            $link = TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_all->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
          } else {
            $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_ALL, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
          }
        }

        $the_button = $link;
        $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . '<br>'. MORE_INFO_TEXT . '</a>';
        $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
      } else {
	        $link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' .  MORE_INFO_TEXT . '</a>';
        $the_button = $link;
        $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' .  MORE_INFO_TEXT . '</a>';
        $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
		
      }

      if (PRODUCT_ALL_LIST_DESCRIPTION > '0') {
        $disp_text = zen_get_products_description($products_all->fields['products_id']);
        $disp_text = zen_clean_html($disp_text);

        $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_ALL_LIST_DESCRIPTION, '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '"> ' .  MORE_INFO_TEXT . '</a>'));
      } else {
        $display_products_description = '';
      }

?>
<table class="tuttiprodotti">
<tr>
<th  >Compara</th>
<th  >Prodotto</th>
<th>Nome</th>
<th >Codice Fornitore</th>
<th>Codice Produttore</th>
<th>Produttore</th>
<th>Prezzo</th>
<?php if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0' ) {?> 	
<div class="wholesale"><th>Prezzo al dettaglio</th></div>
<?php } ?>  
<?php if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0' ) {?> 	
<div class="wholesale"><th>Ricarico</th></div>
<?php } ?>  
<?php if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0' ) {?> 	
<div class="wholesale"><th>Margine</th></div>
<?php } ?>  
<th>Compra Ora</th>
</tr>

 <tr>
 
<td>
<form name="products" action="index.php?main_page=page_3" method="POST" >

<?php
$array = $products_all->fields['products_id'];
echo $array;
echo '<input type="checkbox" name="products[]" value="'. $array .'">';
?>

<input type=submit value=Select>
</form>



<!--<input type="checkbox" name="products[]" value=".'$products_all->fields['products_id']'" /> -->

</td>
<!-- Immagini-->
<td>
          <?php if (PRODUCT_ALL_LIST_IMAGE > '0') { 
                echo $display_products_image;
              ?>
</td>

	<?php
  }
?>

<!-- Nomi-->
    <td>
      <?php if (PRODUCT_ALL_LIST_NAME > '0') {
                echo $display_products_name; 
				
              } ?>
</td> 

<!-- Nomi-->
    <td>
      <?php if (PRODUCT_ALL_LIST_MODEL > '0') { 
                echo $display_products_model;
              } ?>
</td>
    <td>
<?php if (PRODUCT_ALL_LIST_PRODUZIONE > '0') {
      echo $display_products_produzione;
      }?>         
</td>
    <td>
	<?php if (PRODUCT_ALL_LIST_MANUFACTURER > '0') {
               echo $display_products_manufacturers_name;
  } ?>        
</td>
    <td>
<?php if (PRODUCT_ALL_LIST_PRICE > '0') { 
 echo $display_products_price;?>
<?php } ?>      

</td>
<?php if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0' ) {?> 
    <td>

<?php if (PRODUCT_ALL_LIST_PRICE > '0') { 
                echo $display_products_prezzo."EUR";
 }} ?> 
</td>
	<?php if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0' ) {?> 
    <td>
<?php                 echo round($MU,1)."%", "<br><br>";
} ?>  
</td>
<?php if ($_SESSION['customer_whole'] && $_SESSION['customer_whole'] != '0' ) {?>
    <td>
 <?php  echo round($MC,1)."%", "<br><br>";
} ?> 
</td>
	   <td id="buy_now">
      <?php	 if (PRODUCT_ALL_BUY_NOW > '0') { 
                echo $display_products_button;
              ?>
</td>
	<?php } ?>

</tr>
  
</table>

<br>

<?php
      $products_all->MoveNext();
    }
  } else {
?>
</p>
<p><?php echo TEXT_NO_ALL_PRODUCTS; ?></p>
<?php
  }
?>
 

alessandro1997

Utente Attivo
6 Ott 2009
5.302
1
0
27
Roma
alessandro1997.netsons.org
  • 9 Feb 2010
  • #35
Hm... prova a spostare in fondo anche la chiusura del form, altrimenti il bottone rimane fuori.
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 9 Feb 2010
  • #36
Ciao Alessandro!
ho provato ti mostro il codice:
PHP:
<?php
$array = $products_all->fields['products_id'];
echo $array;
echo '<input type="checkbox" name="products[]" value="'. $array .'">';
$confronta= '<input type=submit value=Confronta>';
?>

e nelle ultime righe:
PHP:
<?php
      $products_all->MoveNext();
    }
  } else {
?>



<p><?php echo TEXT_NO_ALL_PRODUCTS; ?></p>
<?php
  }
?>

<?php echo $confronta;?>
</form>

ma la cosa assurda è che mi rimanda nella pagina del carrello e non ne capisco il motivo!
HTML:
index.php?main_page=shopping_cart&disp_order=1

:byebye:
 
R

reeda80

Utente Attivo
15 Giu 2009
46
0
0
  • 10 Feb 2010
  • #37
Giuro l'ultima cosa!
questo form non mi preleva il dato che mi serve (products_id) quando sposto il submit, mentre se il submit viene visualizzato subito dopo il checkbox allora mi viene visulizzato a video il numero di elementi selezionati, in questo caso sempre 1 e il valore (ad es. products_id=8), Quando invece lo metto come nel codice postato qui di seguito oltre a non prelevare il products_id mi rimanda alla pagina del carrello!
Vi prego... qulcuno sa dirmi cosa sbaglio? se salto qualche passaggio... son veramente disperata! Ho provato con condizioni ma... nulla! forse le avevo messe male?
Grazie a tutti in anticipo! :byebye:
PHP:
<table class="tuttiprodotti">
<tr>
<th  >Compara</th>
<th  >Prodotto</th>
<th>Nome</th>
<th>Prezzo</th>
<th>Compra Ora</th>
</tr>   
<tr>   
<td>  
<form name="products" action="index.php?main_page=page_3" method="POST" >
<?php $array = $products_all->fields['products_id'];
$checkbox='<input type="checkbox" name="products[]" value="'. $array .'">';
echo $checkbox;
$button_confronta= '<input type=submit value=Confronta>'; ?>   

<!-- Immagini-->
<td>           
<?php if (PRODUCT_ALL_LIST_IMAGE > '0') {                  
echo $display_products_image;?>
</td>      
<?php   } ?>  

<!-- Nomi-->     
<td>       
<?php if (PRODUCT_ALL_LIST_NAME > '0') {                 
echo $display_products_name; } ?>
</td>   
<!-- Prezzo-->     
<td>
<?php if (PRODUCT_ALL_LIST_PRICE > '0') {   
echo $display_products_price;?> <?php } ?>        
</td>
<!-- Aggiungi n°prodotti e invia-->  
  <td id="buy_now">       
<?php    
if (PRODUCT_ALL_BUY_NOW > '0') {                  
echo $display_products_button; ?>
</td>     
<?php } ?>
</tr>    
</table>  <br> </p>   
<?php       
$products_all->MoveNext();     }   
} else { ?>    
<p>
<?php echo TEXT_NO_ALL_PRODUCTS; ?></p>
<?php   } ?>
<?php   echo $button_confronta;?> </form>
 
Prec.
  • 1
  • 2
Primo Prec. 2 di 2
Devi accedere o registrarti per poter rispondere.

Discussioni simili

F
confrontare due stringhe "numeriche"
  • francescoITA
  • 25 Nov 2020
  • PHP
Risposte
7
Visite
2K
PHP 26 Nov 2020
francescoITA
F
R
Confrontare il dominio di una mail con una stringa contenente un dominio personalizzato, tutto ciò in php o javascript
  • Rametto
  • 10 Giu 2020
  • PHP
Risposte
0
Visite
594
PHP 10 Giu 2020
Rametto
R
S
[PHP] Confrontare due array con valori quasi uguali
  • samurai.sette
  • 18 Nov 2019
  • PHP
Risposte
2
Visite
3K
PHP 23 Nov 2019
samurai.sette
S
A
  • Bloccata
Confrontare il tipo Generics a runtime
  • Ang444
  • 7 Nov 2019
  • Presentati al Forum
Risposte
1
Visite
625
Presentati al Forum 7 Nov 2019
Max 1
E
  • Bloccata
[PHP] confrontare stringhe importate da csv
  • evilsait83
  • 25 Feb 2019
  • PHP
Risposte
19
Visite
3K
PHP 3 Mar 2019
Max 1
Confrontare due array: verificare che tutti i valori di un'array siano contenuti in un'altra.
  • otto9due
  • 5 Ott 2017
  • jQuery
Risposte
1
Visite
6K
jQuery 6 Ott 2017
otto9due
P
[PHP] Confrontare due password e due email
  • paperinik4
  • 14 Giu 2016
  • PHP
Risposte
4
Visite
3K
PHP 17 Giu 2016
paperinik4
P
D
confrontare numero di file
  • djjunior
  • 19 Mag 2014
  • Classic ASP
Risposte
0
Visite
2K
Classic ASP 19 Mag 2014
djjunior
D
A
confrontare dati
  • amhal
  • 16 Apr 2014
  • MySQL
Risposte
8
Visite
1K
MySQL 17 Apr 2014
borgo italia
N
Confrontare due Stringhe
  • Nicola Sità
  • 28 Ago 2013
  • PHP
Risposte
2
Visite
2K
PHP 28 Ago 2013
Nicola Sità
N
M
Confrontare data, ora e aula per evitare sovrapposizioni
  • Marco Nicolè
  • 27 Mag 2013
  • PHP
Risposte
8
Visite
2K
PHP 12 Giu 2013
Longo8
S
Stringhe: confrontare immissione con stringa d'esempio e costruire stringhe da più campi
  • Scar991
  • 14 Mag 2013
  • PHP
Risposte
10
Visite
2K
PHP 18 Giu 2013
borgo italia
P
Unire, confrontare due tabelle da due db diversi fati in phpmyadmin
  • paperinik4
  • 18 Nov 2012
  • Database
Risposte
5
Visite
4K
Database 19 Nov 2012
paperinik4
P
Database: Confrontare una variabile con una colonna di numeri
  • max_400
  • 16 Giu 2011
  • PHP
Risposte
6
Visite
2K
PHP 17 Giu 2011
max_400
G
Confrontare due stringhe
  • gracito
  • 27 Ago 2010
  • PHP
Risposte
11
Visite
4K
PHP 28 Ago 2010
gracito
G
F
confrontare due stringhe c
  • Fabi2089
  • 20 Lug 2010
  • Programmazione
Risposte
0
Visite
2K
Programmazione 20 Lug 2010
Fabi2089
F
I
Confrontare Variabile con Array
  • intimoviro
  • 28 Nov 2009
  • PHP
Risposte
8
Visite
8K
PHP 28 Nov 2009
intimoviro
I
A
Confrontare 2 stringhe in JScript
  • antonietta
  • 29 Lug 2008
  • Classic ASP
Risposte
0
Visite
2K
Classic ASP 29 Lug 2008
antonietta
A
L
confrontare automaticamente due liste excell
  • lucax1234
  • 4 Giu 2008
  • Windows e Software
Risposte
0
Visite
2K
Windows e Software 4 Giu 2008
lucax1234
L
F
confrontare due date
  • felixaf21
  • 21 Apr 2008
  • PHP
Risposte
1
Visite
2K
PHP 21 Apr 2008
Eliox
Condividi:
Facebook X (Twitter) LinkedIn WhatsApp e-mail Condividi Link
  • Home
  • Forum
  • Fare Web
  • PHP
  • Italiano
  • Termini e condizioni d'uso del sito
  • Policy Privacy
  • Aiuto
  • Home
Community platform by XenForo® © 2010-2024 XenForo Ltd. | Traduzione a cura di XenForo Italia
Menu
Accedi

Registrati

  • Home
  • Forum
    • Nuovi Messaggi
    • Cerca...
  • Novità
    • Featured content
    • Nuovi Messaggi
    • Ultime Attività
X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?

X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?