1

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.

1
  • Can you explain what you exactly mean by the PHOTO field and what you expect to see there, the linked image itself or a generic camera icons? Commented Aug 2, 2016 at 19:15

2 Answers 2

2

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>'; ?>
Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.