Buongiorno sto creando un sito dove dovrei poter fare una selezione multipla dei prodotti desiderati, come posso fare per mandare cioè che è stato selezionato al database?
Questo è il codice html del checkbox, dovrei forse farlo in php? Se si mi potreste dire come, scusate,ma sono nuovo nel campo dell'informatica e sul forum
codice HTML:<div id="main2"> <div class="wrapper"> <form action="" method="POST"> <ul> <p>Panini: </p> $query="select * from panini order by nome"; $result= mysqli_query($db,$query); if ($result) { while ($row = mysqli_fetch_assoc($result)) { echo "<input type='checkbox' name='check-box' /> ".$row['nome']." - €".$row['prezzo']."<span></span><br>"; } } </ul> <ul> <p>Contorni: </p> $query="select * from contorni order by nome"; $result= mysqli_query($db,$query); if ($result) { while ($row = mysqli_fetch_assoc($result)) { echo "<input type='checkbox' name='check-box' /> ".$row['nome']." - €".$row['prezzo']."<span></span><br>"; } } </ul> <ul> <p>Bibite: </p> $query="select * from bibite order by nome"; $result= mysqli_query($db,$query); if ($result) { while ($row = mysqli_fetch_assoc($result)) { echo "<input type='checkbox' name='check-box' /> ".$row['nome']." - €".$row['prezzo']."<span></span><br>"; } } </ul> <ul> <p>Dolci: </p> $query="select * from dolci order by nome"; $result= mysqli_query($db,$query); if ($result) { while ($row = mysqli_fetch_assoc($result)) { echo "<input type='checkbox' name='check-box' /> ".$row['nome']." - €".$row['prezzo']."<span></span><br>"; } } </ul> <ul> <p>Caffetteria: </p> $query="select * from caffetteria order by nome"; $result= mysqli_query($db,$query); if ($result) { while ($row = mysqli_fetch_assoc($result)) { echo "<input type='checkbox' name='check-box' /> ".$row['nome']." - €".$row['prezzo']."<span></span><br>"; } } </ul> <p> <input type="submit" name="invia" value="SUBMIT"> <input type="reset" value="RESET"> </p> </div> </form>

Rispondi quotando
