【发布时间】:2014-05-14 10:50:45
【问题描述】:
所以下面的代码从用户选择的行中获取 server_id。但是,我想知道是否可以从行中获取 server_id 和 server_name ,而用户不必比他已经做的更多(选择单选按钮并推送提交)。感谢您的帮助。
<form method="post" name="server_information" id="server_information" action="test.php">
<label>Server Information</label><br><br>
<table border='1'>
<tr>
<th>Selection</th>
<th>User Name</th>
<th>Date Created</th>
<th>Server Name</th>
<th>Server Id</th>
<th>Public DNS</th>
<th>Server Status</th>
</tr>
<?php while($row = mysql_fetch_assoc($result)): ?>
<tr>
<td><input type="radio" name="server" value="<?php echo $row['serverId']; ?>" /></td>
<td><?php echo $row['userName']; ?></td>
<td><?php echo $row['dateCreated']; ?></td>
<td><?php echo $row['serverName']; ?>"</td>
<td><?php echo $row['serverId']; ?></td>
<td><?php echo $row['publicDNS'] ?></td>
<td><?php echo $row['serverStatus']; ?></td>
</tr>
<?php endwhile; ?>
</table>
<br>
<?php endif; ?>
<input type="submit" name="server_stop" value="Stop Server"/>
<input type="submit" name="server_terminate" value="Terminate Server"/>
</form>
【问题讨论】:
标签: php mysql forms post radio-button