//状态属于tblbooking数据库 //下面是我要禁用的按钮 id);? >" class="btn">Request this Vehic-6ren">
gpt4 book ai didi

php - 如果状态为 ='1',如何禁用按钮? (1=已确认)

转载 作者:行者123 更新时间:2023-11-29 16:38:15 24 4
gpt4 key购买 nike

<?php
$vehiclestatus = $row['Status'];
if ($vehiclestatus == '1'){
echo "<h1>reserved</h1>";
}
?>

//状态属于tblbooking数据库
//下面是我要禁用的按钮

<a href="vehical-details.php?vhid=
<?php echo htmlentities($result->id);? >"
class="btn">Request this Vehicle <span class="angle_arrow">
<i class="fa fa-angle-right" aria-hidden="true"></i></span>
</a>

最佳答案

由于您使用的是 anchor 标记而不是按钮,因此无法使用 disabled 属性。但是你可以做这样的事情

<a <?php if($row['Status'] == 1) echo "href='vehical-details.php?vhid=" . htmlentities($result->id) . "'"; ?> class="btn">Request this Vehicle <span class="angle_arrow"><i 
class="fa fa-angle-right" aria-hidden="true"></i></span></a>

如果状态为 1,这只会为标签提供 href 属性。没有 href 本质上与被禁用相同。

关于php - 如果状态为 ='1',如何禁用按钮? (1=已确认),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53474649/

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