我正在从 mysql 填充一个表单。代码是。.
task.php
<div data-role="content">
<h2> Please select cars </h2>
<form method="post" action="cars.php">
<?php
$carq = "select * from cars";
$executecars = mysql_query($carq);
while($row=mysql_fetch_assoc($executecars)){
$cname = $row['name'];
?>
<label for="<?php echo $cname; ?>"><?php echo $cname; ?></label>
<input type="checkbox" name="car" id="<?php echo $cname; ?>" value="<?php echo $cname; ?>"/>
<?php }
?>
<input type="submit" name="submitcars" id="submitcars" value="View Details"/>
</form>
</div>
现在在cars.php中我想查询以显示所选汽车的详细信息,
<div data-role="content">
<?php
if(isset($_POST['submitcars'])){
echo $_POST[$cname];?????????????
}
?>
</div>
现在如何在 cars.php 中处理表格?
谢谢