-1
我想獲取單選按鈕在提取的記錄中的選定值的值..我沒有得到單選按鈕值...告訴我,如果它是正確的或錯誤的..在這種情況下,它是動態的..如果它是靜態的沒有問題..但這是動態的..怎麼做.. ..?或任何替代方法..任何幫助將是可觀的..如何從提取數組結果中檢索單選按鈕的選定值..?
<?php
while($res = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>". "<input type='radio' name= 'Returns'
value=".$res['T_no'].")>". "</td>";
echo "<td>".$res['T_no']."</td>";
?>
<form action="sample.php" method="POST" class="form-inline">
<input type="submit" value="Get Sch"/>
</form>
sample.php
<?php
$con = mysql_connect("localhost", "root", "");
if ($con) {
$db = mysql_select_db('tdb', $con);
} else {
die('Could not connect: ' . mysql_error());
}
echo "you have selected :".$_POST['Returns']; // Displaying Selected Value
echo $POST['Returns'];
$selected_val = $_POST['Returns']; // Storing Selected Value In Variable
echo "You have selected :" .$selected_val; // Displaying Selected Value
$result = mysql_query("SELECT * FROM t_detail WHERE
T_No='$selected_val'");
mysql_close($con)
?>
...謝謝..我正在編輯我的$ _ POST [ '返回'] ..如何使用的foreach .... – user7808845
它給...警告:破滅()[function.implode] :傳遞的參數無效 – user7808845
如果我刪除查詢...沒有得到選定的值.. ..如何獲得該值... – user7808845