Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.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_Html_Css_Mysqli - Fatal编程技术网

使用php禁用按钮,不工作

使用php禁用按钮,不工作,php,html,css,mysqli,Php,Html,Css,Mysqli,有人能推荐我使用的osclass开源软件吗。 我不知道为什么条件不起作用 <button type="button" class="button-ii" <?php if(osc_item_formated_price()=="Only Information Available" || $email == "OFF") {?> disabled="true" <?php } ?><?php>data-toggle="modal"disabled da

有人能推荐我使用的osclass开源软件吗。 我不知道为什么条件不起作用

<button type="button" class="button-ii" <?php if(osc_item_formated_price()=="Only Information Available" || $email == "OFF")  {?> disabled="true" <?php } ?><?php>data-toggle="modal"disabled data-target="#myModal">Enquiry</button>

试着用不同的方法来做

<?php if(osc_item_formated_price()=="Only Information Available" || $email == "OFF") { ?>
    <button type="button" class="button-ii" disabled>Enquiry</button>
<?php } else { ?>
    <button type="button" class="button-ii" data-toggle="modal" data-target="#myModal">Enquiry</button>
<?php } ?>

询问
询问


因为您在使用PHP代码时做了错误的操作,所以您有一个额外的
disabled=“true”>data toggle=“modal”disabled data target=“#myModal”>查询

欢迎来到SO,您尝试了哪些方法来实现您想要的结果?关于你的问题,你的研究表明了什么?你能提供你的代码吗?如有需要,请提供一份表格。也请花时间阅读
<?php if(osc_item_formated_price()=="Only Information Available" || $email == "OFF") { 
    echo '<button type="button" class="button-ii" disabled>Enquiry</button>';
} else {
    echo '<button type="button" class="button-ii" data-toggle="modal" data-target="#myModal">Enquiry</button>';
}
<button type="button" class="button-ii" 
<?php if(osc_item_formated_price()=="Only Information Available" || $email == "OFF")  
{?> disabled="true" <?php } ?> >data-toggle="modal"disabled data-target="#myModal">Enquiry</button>