Problem with a form in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
reeda80
Forum Newbie
Posts: 2
Joined: Wed Feb 10, 2010 9:20 am

Problem with a form in php

Post by reeda80 »

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 = 8), 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! :banghead:
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>
reeda80
Forum Newbie
Posts: 2
Joined: Wed Feb 10, 2010 9:20 am

Re: Problem with a form in php

Post by reeda80 »

No One can help a Italian desperate?
:D
Bye bye and good night for you!
Here in Sicily today there's a wonderfull sun!
Bye from Sicily!
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: Problem with a form in php

Post by klevis miho »

The code looks messy and it's in italian :(
Post Reply