【问题标题】:php image link in table code表格代码中的php图像链接
【发布时间】:2023-03-28 06:00:02
【问题描述】:

我的 php 动态表中有这段代码

<?php echo'<a href="http://'.$row_rsInventory['PHOTO'].'"><img src="../images/a-camera-icon.png">'.$row_rsInventory['PHOTO'].'</a>'; ?>

当代码运行时,它会将链接显示为图像,并将文本显示为 PHOTO 字段中的超链接。我需要更改什么,以便它仅在 PHOTO 字段中将链接显示为图像。感谢您对此提供的任何帮助。

【问题讨论】:

  • 您能否解释一下 PHOTO 字段的确切含义以及您希望在那里看到的内容、链接图像本身或通用相机图标?

标签: php html image hyperlink


【解决方案1】:

这样删除锚.$row_rsInventory['PHOTO'].的文本即可

<?php echo'<a href="http://'.$row_rsInventory['PHOTO'].'">
        <img src="../images/a-camera-icon.png">
</a>'; ?>

【讨论】:

    【解决方案2】:

    删除锚文本.$row_rsInventory['PHOTO'] 使用以下任一代码

    <a href="http://<?php echo $row_rsInventory['PHOTO']; ?>"><img src="../images/a-camera-icon.png"></a>
    
    <?php echo'<a href="http://'.$row_rsInventory['PHOTO'].'"><img src="../images/a-camera-icon.png"></a>'; ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多