 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
ainoy31
Joined: 25 May 2007 Posts: 5
|
Posted: Wed May 30, 2007 7:05 am Issue with Radio Button in PHP |
|
|
|
I am trying to pass a value from one page to another using a radio button in PHP. I am using a database to query the info as well. Here is a section of the code:
<td align = "center"><font face = "Ariel, Helvetica, sans-serif"><input type = "radio" name = "id" ><?=$id;?></font></td>
On the next page I am posting the value as $select = $_POST['id'];
Any help would be much appreciated.
Thx. AM |
|
flann
Joined: 04 May 2007 Posts: 14
|
Posted: Wed May 30, 2007 11:51 am |
|
|
|
This:
<td align = "center"><font face = "Ariel, Helvetica, sans-serif"><input type = "radio" name = "id" ><?=$id;?></font></td>
Should be:
<td align = "center"><font face = "Ariel, Helvetica, sans-serif"><input type = "radio" name = "id" value="<?=$id;?>"></font></td>
where the $id is in the value attribute in the radio element. Also, although the short tags will work, the preferred method is...
<?php echo($id); ?> |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|