如何使用php禁用和启用基于条件的锚定标记
如何根据订单状态条件禁用和启用锚定标记?我想让我的收据按钮只能在订单状态更新为($irow['order\u status']==5)时单击。如果你们都能给我提供一个代码演示,告诉我如何使用php实现,我将不胜感激。谢谢 我尝试了下面的代码,但不起作用。它显示了如何使用php禁用和启用基于条件的锚定标记,php,if-statement,anchor,Php,If Statement,Anchor,如何根据订单状态条件禁用和启用锚定标记?我想让我的收据按钮只能在订单状态更新为($irow['order\u status']==5)时单击。如果你们都能给我提供一个代码演示,告诉我如何使用php实现,我将不胜感激。谢谢 我尝试了下面的代码,但不起作用。它显示了解析错误的错误:语法错误,意外的'order\u id'(t\u STRING)。我不知道为什么会发生这种情况。你们能帮我实现吗 <?php if($order_status == 5){ print
解析错误的错误:语法错误,意外的'order\u id'(t\u STRING)
。我不知道为什么会发生这种情况。你们能帮我实现吗
<?php
if($order_status == 5){
print ' <a id="receiptbtn" target="_blank"
href="
receipt.php?order_id=<?php echo $row['order_id']; ?>"
class="btn addtocart" style="font-size: 12px;"><span class="iconify" data-icon="bx:bx-download" data-inline="false"></span> Receipt</a>';
}
else{
print '<a href="" class="disabled-link">Receipt</a>';
}
?>
你已经在你已经在你没有放置@Barmar如果我没有放置php,那么我如何将它链接到相应的页面?你使用字符串连接。打印'string1'。$variable。'string2';
你没有放置@Barmar如果我没有放置php,那么我如何将它链接到相应的页面?你使用字符串conca国家。打印'string1'。$variable。'string2';
但我的按钮无法链接到我想要的页面。它只是在页面中重新加载,这就是href=“
的意思。使用href=“#”
使链接不起任何作用。但是当订单状态
不是==5
时,按钮会起作用。我可以知道当订单状态不是5时如何禁用它吗?$order\u status
应该是$irow['order\u status']
但我在尝试访问null类型值上的数组偏移量时遇到错误,但我的按钮无法链接到我想要的页面。它只是在页面中重新加载,这就是href=“
的意思。使用href=“#”
使链接不起任何作用。但是当订单状态
不是==5
时,按钮会起作用。我能知道当订单状态不是5时如何禁用它吗?$order\u status
应该是$irow['order\u status']
但是我遇到了一个错误,试图访问null类型值上的数组偏移量
<?php
if($irow['order_status'] == 5){
print ' <a id="receiptbtn" target="_blank"
href="receipt.php?order_id=' . $row['order_id'] . '"
class="btn addtocart" style="font-size: 12px;"><span class="iconify" data-icon="bx:bx-download" data-inline="false"></span> Receipt</a>';
}
else{
print '<a href="#" class="disabled-link">Receipt</a>';
}
?>