Ciao a tutti. Sto avendo dei problemi con un form, ecco il codice:
Codice PHP:
<html> <body> <?php if(isset($_COOKIE['user'])){ require('config.php'); echo"$_COOKIE[user]"; $query=mysql_query("SELECT * FROM listaiscrittiseriea2010 WHERE Username='$_COOKIE[user]' "); $query2=mysql_num_rows($query); $query3=mysql_result($query,0,'Nome'); $querr=mysql_query("SELECT*FROM `CalcioSerieA`.`caratteristichea` "); $result=mysql_result($querr,0,'Giornata'); echo"<form name='parere' method='POST' action='sposta.php'>"; echo"$query3"; $num3=12; echo"$num3"; echo"Giocatori in campo"; echo"<table width='550' border='1'>"; for($num2=1;$num2<$num3;$num2++){ $giocatore=mysql_query("SELECT*FROM `calcioseriea`.`calcioa.classicoa.$query3` WHERE id='$num2'"); $codice=mysql_result($giocatore,0,'Codice'); $id=mysql_result($giocatore,0,'id'); $nome=mysql_result($giocatore,0,'Giocatore'); $ruolo=mysql_result($giocatore,0,'Ruolo'); $costo=mysql_result($giocatore,0,'Costo'); echo"<tr>";echo"<td> <input type=radio name='giudizio' value='$nome'> </td>"; echo"<td width='58%'> $nome </td>"; if($ruolo==0){echo"<td width='14%'>P</td>";} elseif($ruolo==1){echo"<td width='14%'>D</td>";} elseif($ruolo==2){echo"<td width='14%'>C</td>";} elseif($ruolo==4){echo"<td width='14%'></td>";} else{echo"<td width='14%'>A</td>";} if($costo==0){echo"<td width='14%'></td>";}else{ echo"<td width='14%'>$costo</td>";} if($costo==0){if($result==0){echo"<form name='Compra' method='POST' action='compra.php'>"; echo"<input type='hidden' name='id' value='$id'>"; echo"<input type='hidden' name='prezzo1' value='0'>"; echo"<td width='14'><input type='submit' value=compra name='compra'></td>"; echo"</form>";}} if($costo!=0){if($result==0){echo"<form name='Compra' method='POST' action='compra.php'>"; echo"<input type='hidden' name='id' value='$id'>"; echo"<input type='hidden' name='prezzo1' value='$costo'>"; echo"<td width='14'><input type='submit' value=vendi name='vendi'></td>"; echo"</form>";}} echo"</tr>"; echo""; echo"";} echo"</table>"; $num5=24; echo"giocatori in panchina"; echo"
"; if($result==0){ echo"<input type='submit' value=sposta name='sposta'>";} echo"<table width='550' border='1'>"; for($num4=12;$num4<$num5;$num4++){$giocatore=mysql_query("SELECT*FROM `calcioseriea`.`calcioa.classicoa.$query3` WHERE id='$num4'"); $codice=mysql_result($giocatore,0,'Codice'); $id=mysql_result($giocatore,0,'id'); $nome=mysql_result($giocatore,0,'Giocatore'); $ruolo=mysql_result($giocatore,0,'Ruolo'); $costo=mysql_result($giocatore,0,'Costo'); echo"<tr>"; echo"<td> <input type=radio name='giudizio1' value='$nome'> </td>"; echo"<td width='58%'> $nome </td>"; if($ruolo==0){echo"<td width='14%'>P</td>";} elseif($ruolo==1){echo"<td width='14%'>D</td>";} elseif($ruolo==2){echo"<td width='14%'>C</td>";} elseif($ruolo==4){echo"<td width='14%'></td>";} else{echo"<td width='14%'>A</td>";} if($costo==0){echo"<td width='14%'></td>";}else{ echo"<td width='14%'>$costo</td>";} if($costo==0){echo"<form name='Compra1' method='POST' action='compra.php'>"; echo"<input type='hidden' name='id' value='$id'>"; echo"<input type='hidden' name='prezzo1' value='0'>"; echo"<td width='14'><input type='submit' value=compra name='compra'></td>"; echo"</form>";} if($costo!=0){ echo"<form name='Compra' method='POST' action='compra.php'>"; echo"<input type='hidden' name='prezzo1' value='$costo'>"; echo"<input type='hidden' name='id' value='$id'>"; echo"<td width='14'><input type='submit' value=vendi name='vendi'></td>"; echo"</form>";} echo"</tr>"; echo""; echo""; }echo"</table>"; echo"<input type='hidden' name='squadra' value='$query3'>"; echo"</form>"; } else{header("location:login.php");}?> </body> </html>
c'è un ciclo for per farcreare ogni riga con ogni giocatore e un form per ogni riga, questi form sono poi all'interno di auntrlo from,, acausa del quale il primo form che il ciclo for mi produce non funziona e non riesco a capirne il motivo, potete dare un'occhiata??