bubbles Posted February 19, 2013 Report Share Posted February 19, 2013 Am urmatorul cod :<?phpif ($_POST['pret_total']){$checked = $_POST['produs'];if (!$checked) { $totalprice='Nu ati selectat produse';} else { foreach($checked as $item) { $totalprice+=$item;$totalprice.=' lei';}}}$result = mysql_query("SELECT * FROM produse");while($row = mysql_fetch_array($result)){echo "<tr><td width='200px' align='center'><img width='50px' style='border:1px solid #909090;' src='images/products/".$row['id'].".jpg'></td><td width='300px' align='center'>".$row['nume']."</td><td width='300px' align='center'>".$row['pret']." lei</td><td width='50px' align='center'><input type='checkbox' name='produs[]' value='".$row['pret']."' ></td></tr>";}?>Cum as putea face ca produsele selectate sa imi mai apara inca o data pe pagina ? Quote Link to comment Share on other sites More sharing options...
Vlachs Posted February 20, 2013 Report Share Posted February 20, 2013 Nu prea inteleg ce vrei sa spui cu "sa mai apara inca o data pe pagina", te referi sa le pui in output inca o data? Quote Link to comment Share on other sites More sharing options...
bubbles Posted February 20, 2013 Author Report Share Posted February 20, 2013 Scuze, eram prea obosit.@ElChief - da. Quote Link to comment Share on other sites More sharing options...
evangilbort Posted April 27, 2013 Report Share Posted April 27, 2013 (edited) There are often situations where a group of related checkboxes are needed on a form. The advantage of check box group is that the user can select more than one options. checkboxes are used to give visitors a choice of options. Edited May 1, 2013 by evangilbort Quote Link to comment Share on other sites More sharing options...
nedo Posted May 5, 2013 Report Share Posted May 5, 2013 O solutie ar fii ca inainte sa faci echo-ul in care le printezi sa le asignezi intr-un nou array. Dupa asta mai faci un foreach pe noul array si aia e. Quote Link to comment Share on other sites More sharing options...