HTML部分在下面给出
<a download="<?php echo $value['product_name']; ?>" href="Image/<?php echo $value['product_image']; ?>" title="<?php echo $value['product_name']; ?>" style = "cursor: not-allowed" class="download" disabled="disabled"> Download</a>
如果数据库中没有图像,如何阻止用户下载图像?
答案 0 :(得分:0)
在if
声明中:
<?php if ($value['product_image']){?>
<a download="<?php echo $value['product_name']; ?>" href="Image/<?php echo $value['product_image']; ?>" title="<?php echo $value['product_name']; ?>" style = "cursor: not-allowed" class="download" disabled="disabled"> Download</a>
{?php } ?>