RCS Posted April 19, 2008 Share Posted April 19, 2008 what if I wanted to have it so echo "<td><img src =\"upload/" . $row['name']."\"></td>"; has a hyperlink added to the image say http://somesite.com I can't seem to find any info on this anywhere. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/101891-solved-link-to-image/ Share on other sites More sharing options...
Northern Flame Posted April 19, 2008 Share Posted April 19, 2008 then it would be: echo "<td><a href="http://somesite.com"><img src =\"upload/" . $row['name']."\"></a></td>"; Link to comment https://forums.phpfreaks.com/topic/101891-solved-link-to-image/#findComment-521446 Share on other sites More sharing options...
RCS Posted April 19, 2008 Author Share Posted April 19, 2008 what if I wanted to have it so echo "<td><img src =\"upload/" . $row['name']."\"></td>"; has a hyperlink added to the image say http://somesite.com I can't seem to find any info on this anywhere. Thanks in advance. see I thought that "<td><a \"$row[name]\">$row[name]</a> <a href="http://somesite.com"><img src=\"upload/"></a></td>"; But It don't work Link to comment https://forums.phpfreaks.com/topic/101891-solved-link-to-image/#findComment-521448 Share on other sites More sharing options...
RCS Posted April 19, 2008 Author Share Posted April 19, 2008 see the http://somesite.com is not in the database this time it's one page that will be added to all images Link to comment https://forums.phpfreaks.com/topic/101891-solved-link-to-image/#findComment-521450 Share on other sites More sharing options...
southofsomewhere Posted April 19, 2008 Share Posted April 19, 2008 echo "<td><a href=somesite.com><img src=upload/".$row['name']."></a></td>"; Just need to put the ahref tag around your image. Link to comment https://forums.phpfreaks.com/topic/101891-solved-link-to-image/#findComment-521452 Share on other sites More sharing options...
RCS Posted April 19, 2008 Author Share Posted April 19, 2008 OK thank you very much!! Link to comment https://forums.phpfreaks.com/topic/101891-solved-link-to-image/#findComment-521455 Share on other sites More sharing options...
Northern Flame Posted April 19, 2008 Share Posted April 19, 2008 oops i meant to put the ahref tag around the image in my post, but yea, thats how you would do it echo "<td><a href="http://somesite.com"><img src =\"upload/" . $row['name']."\"></a></td>"; Edit: oh I didnt see south of somewhere's post Link to comment https://forums.phpfreaks.com/topic/101891-solved-link-to-image/#findComment-521456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.