brown2005 Posted February 20, 2007 Share Posted February 20, 2007 while($profile_array = mysql_fetch_array($profile_query)) { echo"<tr> <td width='300'>$home vs $away<input type='hidden' value='$id' name='$id_game'></td> <td width='100'><input type='radio' value='1' name='$id_result'></td> <td width='100'><input type='radio' value='2' name='$id_result'></td> <td width='100'><input type='radio' value='3' name='$id_result'></td> </tr>"; } i have the above but how will i echo this on the post page. Link to comment https://forums.phpfreaks.com/topic/39300-football-results/ Share on other sites More sharing options...
peterbarone Posted February 20, 2007 Share Posted February 20, 2007 you can try this. But I'm just learning also. It works on my page <form action="postpage.php" method="post" name="postid"> <tr> <td width='300'>$home vs $away<input type='hidden' value='$id' name='$id_game'></td> <td width='100'><input type='radio' value='1' name='$id_result'></td> <td width='100'><input type='radio' value='2' name='$id_result'></td> <td width='100'><input type='radio' value='3' name='$id_result'></td> </tr> </form> then on your postpage $id_result=$_POST['$id_result']; echo $id_results; //should show the radio button selected Link to comment https://forums.phpfreaks.com/topic/39300-football-results/#findComment-189480 Share on other sites More sharing options...
brown2005 Posted February 21, 2007 Author Share Posted February 21, 2007 while($profile_array = mysql_fetch_array($profile_query)) { $id = $profile_array['games_id']; $home = $profile_array['games_home']; $away = $profile_array['games_away']; echo" <tr> <td width='50'>$id<input type='hidden' value='$id' name='$id'></td> <td width='300'>$home vs $away<input type='hidden' value='$id' name='{$id}_game'></td> <td width='100'><input type='radio' value='1' name='{$id}_result'></td> <td width='100'><input type='radio' value='2' name='{$id}_result'></td> <td width='100'><input type='radio' value='3' name='{$id}_result'></td> </tr>"; } Is the above correct, what it does is take four fixtures from a table and displays them, so i used the {id} bit to give each record a sperate id, is this correct or is there a better way? Link to comment https://forums.phpfreaks.com/topic/39300-football-results/#findComment-190362 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.