Steve D
Steve D

Reputation: 33

php image link in table code

I have this code in my php dynamic table

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

When the code runs it displays the link as an image and the text as a hyperlink in the PHOTO field. What do I need to change so that it just shows the link as an image in the PHOTO field. I appreciate any help on this.

Upvotes: 1

Views: 408

Answers (2)

muya.dev
muya.dev

Reputation: 977

Remove the anchor text .$row_rsInventory['PHOTO'] Use either of the code below

<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>'; ?>

Upvotes: 0

ScaisEdge
ScaisEdge

Reputation: 133360

Just remove the text you have for anchor .$row_rsInventory['PHOTO']. this way

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

Upvotes: 2

Related Questions