Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用php禁用和启用基于条件的锚定标记_Php_If Statement_Anchor - Fatal编程技术网

如何使用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

如何根据订单状态条件禁用和启用锚定标记?我想让我的收据按钮只能在订单状态更新为($irow['order\u status']==5)时单击。如果你们都能给我提供一个代码演示,告诉我如何使用php实现,我将不胜感激。谢谢

我尝试了下面的代码,但不起作用。它显示了
解析错误的错误:语法错误,意外的'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>';
    }
    ?>