代码运行时我无法获得任何价值,请帮助
HTML部分:
<form method="post">
<select name="rebuild">
<?php while($lo = mysqli_fetch_assoc($resultt)) { ?>
<option value="<?php echo $lo["company_name"]; ?>">
<?php echo $lo["company_name"]; ?>
</option>
<?php } ?>
</select>
</form>
PHP部分:
if (isset($_POST['rebuild'])) {
$re = $_POST['rebuild'];
}
else {
$re = " ";
}
echo $re;
答案 0 :(得分:0)
试试这个
<form method="post">
<select name="rebuild">
<?php while($lo = mysqli_fetch_assoc($resultt)) { ?>
<option value="<?php echo $lo["company_name"]; ?>">
<?php echo $lo["company_name"]; ?>
</option>
<?php } ?>
</select>
<input type="submit" name="submit">
</form>
你的PHP部分
if (isset($_POST['submit'])) {
$re = $_POST['rebuild'];
echo $re;
exit();
}