Problem with a form in php
Posted: Wed Feb 10, 2010 9:34 am
Hello everyone!
I created this form but it did not pick the data that I need (products_id) when I move the submit (In the bottom of my page), but it works when submit is displayed just after the checkbox on the screen, but the number of items selected in this case always is one and value is correct (eg. products_id =
, when instead I put in the code as posted below in addition to not take the products_id and brings me to the shopping cart page!
Please ... Someone can tell me what wrong? whether missed one step ... I'm really desperate! I tried it with conditions, but ... nothing! maybe I had made wrong?
Thank you all in advance!
Bye bye!
I created this form but it did not pick the data that I need (products_id) when I move the submit (In the bottom of my page), but it works when submit is displayed just after the checkbox on the screen, but the number of items selected in this case always is one and value is correct (eg. products_id =
Please ... Someone can tell me what wrong? whether missed one step ... I'm really desperate! I tried it with conditions, but ... nothing! maybe I had made wrong?
Thank you all in advance!
Bye bye!
Code: Select all
<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>