gpt4 book ai didi

php - PHP 代码中的选择标签与下一个

标签重叠

转载 作者:太空宇宙 更新时间:2023-11-04 06:23:00 26 4
gpt4 key购买 nike

我尝试创建不同的 div 标签,但 PHP 代码中的 select 标签仍然与它重叠。我什至尝试过使用

<body>
<header>
<div class="bgimg">
<?php include('includes/navbar.php') ?>
<form onsubmit="" action="changeemployee.php" method="POST">
<div class="row text-white m-auto">
<div class="col-lg-4 col-md-4 col-sm-12">
<h2 class="text-center">Select Username</h2>
<label>Select Employee's Username</label>
<?php
$query = "SELECT empusername FROM empcredential";
$result = mysqli_query($db, $query);
echo "<select class='custom-select' name='empusername'>";
while($row = mysqli_fetch_array($result))
{
echo "<option value='".$row['empusername']."'>".$row['empusername']."</option>";
}
?>
</div>
<div class="col-lg-4 col-md-4 col-sm-12">
<!--Corresponding Address-->
<h2 class="text-center">Corresponding Address</h2>
<label for="empcoraddress">Address</label>
<input type="text" class="form-control" id="empcoraddress" name="empcoraddress" required>
<label for="empcorctv">City/Town/Village</label>
</div>````

最佳答案

我想你忘了关闭选择标签

<?php
$query = "SELECT empusername FROM empcredential";
$result = mysqli_query($db, $query);
echo "<select class='custom-select' name='empusername'>";
while($row = mysqli_fetch_array($result))
{
echo "<option value='".$row['empusername']."'>".$row['empusername']."</option>";
}
echo "</select>";
?>

关于php - PHP 代码中的选择标签与下一个 <h2> 标签重叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55313581/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com