Php 将单选按钮值传递给表单提交

Php 将单选按钮值传递给表单提交,php,radio-button,form-submit,Php,Radio Button,Form Submit,我想知道是否有人能帮我 我把页面放在一起,允许用户查看保存在他们帐户中的记录 我现在要做的是添加一个功能,用户可以选择一个单选按钮,点击“位置详细信息”图标,然后进入与他们选择单选按钮的记录相关的“详细信息页面” 我遇到的问题是,无论我选择哪个单选按钮,当我点击图标时,我总是被带到最后一条记录的“详细信息页面”(*NB*在本文中,我已将“提交”操作从按钮上移开。) 下面的代码创建表和“位置详细信息”图标 <table id="theTable" width="835" class="so

我想知道是否有人能帮我

我把页面放在一起,允许用户查看保存在他们帐户中的记录

我现在要做的是添加一个功能,用户可以选择一个单选按钮,点击“位置详细信息”图标,然后进入与他们选择单选按钮的记录相关的“详细信息页面”

我遇到的问题是,无论我选择哪个单选按钮,当我点击图标时,我总是被带到最后一条记录的“详细信息页面”(*NB*在本文中,我已将“提交”操作从按钮上移开。

下面的代码创建表和“位置详细信息”图标

 <table id="theTable" width="835" class="sortable-onload-zebra no-arrow rowstyle-alt colstyle-alt paginate-20 max-pages-20 paginationcallback-callbackTest-calculateTotalRating paginationcallback-callbackTest-displayTextInfo sortcompletecallback-callbackTest-calculateTotalRating">
              <thead>
                <tr>
                  <th width="60" bgcolor="#ff8401">Select</th>
                  <th width="150" class="sortable-text" bgcolor="#ff8401">Location</th>
                  <th width="300" class="sortable-text" bgcolor="#ff8401">Address</th>
                  <th width="30" class="sortable-text" bgcolor="#ff8401">Finds</th>
                </tr>
              </thead>
              <tbody>
                <?php
                    mysql_data_seek($result, 0);
                    while ($row = mysql_fetch_array($result)) {
                        /* display row for each user */

                ?>
                <tr height="80px">
                  <td style="text-align: center"><input type="radio" id="lid" name="lid" value=<?php echo $row['locationid'];?> /></td>
                  <td style="text-align: left"><strong><?php echo $row['locationname'];?></strong></td>
                  <td style="text-align: center"><?php echo $row['returnedaddress'];?></td>
                  <td style="text-align: center"><strong><em><?php echo $row['totalfinds'];?></em></strong></td>

            </tr>

                <?php
                        }
                    } else {
                        echo "<tr>
                                 <td>&nbsp;</td>
                                 <td>&nbsp;</td>
                                 <td>&nbsp;</td>
                                 <td>&nbsp;</td>
                                 <td>&nbsp;</td>                                     
                            </tr>
                            <tr>
                                 <td colspan='5'><div align='center'><strong>No locations have been added yet. <a href='addlocation.php'>Click here</a> to add one.</strong></div></td>
                            </tr>
                            <tr>
                                 <td>&nbsp;</td>
                                 <td>&nbsp;</td>
                                 <td>&nbsp;</td>
                                 <td>&nbsp;</td>
                                 <td>&nbsp;</td>
                            </tr>";

}

?>  
              <form action='locationsaction.php'>
              <input type='submit' class='detailsButton' name='type' value='Details' alt='Location Details' title='Location Details' style='margin-right:10px' />
              </form>   
            </tbody>
            </table>

挑选
位置
地址
发现



这是您当前的表格:

<form action='locationsaction.php'>
<input type='submit' class='detailsButton' name='type' value='Details' alt='Location Details' title='Location Details' style='margin-right:10px' />
</form> 

你的桌子一点也不像你的样子;当您单击submit按钮时,它将只发送
标记之间输入的详细信息


如果移动
,这是您当前的表单:

<form action='locationsaction.php'>
<input type='submit' class='detailsButton' name='type' value='Details' alt='Location Details' title='Location Details' style='margin-right:10px' />
</form> 

你的桌子一点也不像你的样子;当您单击submit按钮时,它将只发送
标记之间输入的详细信息


如果您移动
,我相信您的开始表单标签应该位于最上面的输入类型字段上方。我不完全确定,但这是我注意到的第一件事。

我认为您的开始表单标签应该位于最上面的输入类型字段上方。我不完全确定,但这是我注意到的第一件事。

Hi@andrewsi,非常感谢您抽出时间回复我的帖子。我一发表这篇文章就无意中发现了另一篇教程,它基本上证实了你的观点。善良的regardsHi@andrewsi,非常感谢您抽出时间回复我的帖子。我一发表这篇文章就无意中发现了另一篇教程,它基本上证实了你的观点。尊敬的格伦·普拉斯,谢谢你花时间来回复。正如我在对@andrewsi的评论中所说,我一发表这篇文章,就发现了一个教程,它重申了你的观点。我注意到我们确实相隔17秒。用于确认解决方案的Tx!嗨,格伦·普拉斯,谢谢你花时间来回复。正如我在对@andrewsi的评论中所说,我一发表这篇文章,就发现了一个教程,它重申了你的观点。我注意到我们确实相隔17秒。用于确认解决方案的Tx!