Jump to content

Football Results


brown2005

Recommended Posts

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

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

  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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.