그래서 여기에 문제가 있습니다. mysql 쿼리를 실행하고 해당 쿼리의 결과를 while 문과 함께 라디오 버튼에 던지고 있습니다. 라디오 버튼의 양은 다양 할 수 있으므로 POST 함수를 사용하여 설정할 수 없습니다. 사용자가 행 중 하나를 선택하고 쿼리의 "serverId"데이터를 test.php 페이지로 전달할 수 있도록하기 위해 고심하고 있습니다. 어떤 도움이라도 대단히 감사하겠습니다. 감사.라디오 버튼 POST 문제
<html>
<head>
<title>Server Information</title>
</head>
<body>
<?php
//Starts the session and grabs the username from it
session_start();
$name=mysql_real_escape_string($_SESSION['username']);
include 'header.php';
include 'mysql_connect.php';
mysql_select_db('ist421test');
$result = mysql_query("SELECT userName, dateCreated, serverName, serverId, publicDNS, isRunning FROM server_tbl WHERE userName='$name' ORDER BY dateCreated DESC") or die(mysql_error());
if(mysql_num_rows($result) > 0): ?>
<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>Running</th>
</tr>
<?php while($row = mysql_fetch_assoc($result)): ?>
<tr>
<td><input method="post" type="radio" name="server" value="server_information" action="test.php"></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['isRunning']; ?></td>
</tr>
<?php endwhile; ?>
</table>
<input type="submit" name="server_stop" value="Stop Server"/>
<input type="submit" name="server_terminate" value="Terminate Server"/>
</form>
<?php endif; ?>
</body>
</html>
이것은 필드에 라디오 버튼을 표시 만하지만, php 명령을 둘러싼 따옴표로 인해 레코드를 더 이상 표시하지 않습니다. 공백입니다. 어떤 아이디어. – h3tr1ck
브라우저에서 페이지 소스를보고 제작중인 코드를 붙여 넣을 수 있습니까? (아마도 위의 질문을 업데이트하십시오) – Wireblue
틀렸어. 사과드립니다. 실제로 serverid 필드에 라디오 버튼을 표시하고 serverid의 데이터를 다음 필드로 밀어 넣습니다. 하지만 이제는 잘 작동합니다. 단지 라디오 버튼과 같은 필드에 serverid가 표시되지 않습니다. – h3tr1ck