Ciao a tutti,
ho un form come questo:
ed il codice per l'inserimento:codice:<form action="?do=4" method="POST" > <table width="530"> <tr> <td width="30"><input name="giorno" type="hidden" value="Ven" />Ven</td> <td width="20"><input name="numero" type="hidden" value="1" />1</td> <td width="60"><input name="mese" type="hidden" value="Agosto" />Agosto</td> <td width="320"><textarea name="testo" cols="35" ></textarea></td> <td width="100"><input name="numero" type="checkbox" value="si" /> Importante!</td> </tr> <tr> <td width="30"><input name="giorno" type="hidden" value="Sab" />Sab</td> <td width="20"><input name="numero" type="hidden" value="2" />2</td> <td width="60"><input name="mese" type="hidden" value="Agosto" />Agosto</td> <td width="320"><textarea name="testo" cols="35" ></textarea></td> <td width="100"><input name="importante" type="checkbox" value="si" /> Importante!</td> </tr> <tr> <td width="30"><input name="giorno" type="hidden" value="Dom" />Dom</td> <td width="20"><input name="numero" type="hidden" value="3" />3</td> <td width="60"><input name="mese" type="hidden" value="Agosto" />Agosto</td> <td width="320"><textarea name="testo" cols="35" ></textarea></td> <td width="100"><input name="numero" type="checkbox" value="si" /> Importante!</td> </tr> </table> <input name="submit" type="submit" value="Invia">
Il problema é che mi inserisce solo i dati dell'ultimo <tr>..... e gli altri? Perché?codice:$giorno = $_POST["giorno"]; $numero = $_POST["numero"]; $mese = $_POST["mese"]; $testo = $_POST["testo"]; $importante = $_POST["importante"]; $inserimento="INSERT INTO `calendario` (id,giorno,numero,mese,anno,testo,importante) VALUES ('','$giorno','$numero','$mese','$anno','$testo','$importante')"; $risultato=mysql_query($inserimento, $link); if($risultato) echo "Inserito con successo!";

Rispondi quotando