Reputation: 47
<?php
$image = "image-link.png";
$width = 300;
$height = 280;
echo '<img src="'.$image.'" style=width:"' . $width . 'px;height:' . $height . 'px;">';
?>
I just want to be able to click on the image and it will go to an external link. I am confused on how to do this next step
Upvotes: 0
Views: 551
Reputation: 57729
echo '<a href="http://stackoverflow.com"><img src="'.$image.'" style=width:"'
. $width . 'px;height:' . $height . 'px;"></a>';
Now clicking the image will take you to stackoverflow.com
Upvotes: 2