我有以下表格,其中从 mysql 数据库中检索数据。
<?php
$get_name = mysql_query("SELECT * from premises WHERE status = 0") or die(mysql_error());
while($motel = mysql_fetch_array($get_name)){
?>
<form method="post" action="includes/loanprocess.php">
<tr>
<td width="50"><input type="checkbox" name="m_id" value="<?php echo $motel['ID'];?>" /></td><td><?php echo $motel['name'];?></td><td><?php echo $motel['ID'];?></td><td><?php echo $motel['address'];?>
</td>
</tr>
<?php
}
?>
<tr>
<td></td>
<td><input type="submit" value="Proceed to Enter Details" /></td>
<td></td>
</form>
我需要通过复选框将值发送到另一个页面。要捕获数据,loanprocess.php 的代码是
<?php
include_once("connection.php");
$id = $_POST['m_id'];
foreach ($id as $key => $value) {
$m_id = str_replace("'", "'", $key);
echo $m_id;
}
?>
它不工作。