sildona Posted October 25, 2012 Share Posted October 25, 2012 The following echo "<img src='".$image."' height='200px' />"; shows an image from a database. How do I get a link to automatically add itself to the image? I would have to enter the URL address into the database and call that address into a variable then href=$linkvariable to the above img source. Correct? Quote Link to comment Share on other sites More sharing options...
Jessica Posted October 25, 2012 Share Posted October 25, 2012 Yes, store the url in the database, then just echo the html for the link around the image. Quote Link to comment Share on other sites More sharing options...
Psycho Posted October 25, 2012 Share Posted October 25, 2012 Your question is a bit confusing. If you are wanting the image to be a hyperlink to just the image then all you need to do is this. echo "<a href='{$image}'><img src='{$image}' height='200px' /></a>"; Quote Link to comment Share on other sites More sharing options...
sildona Posted October 25, 2012 Author Share Posted October 25, 2012 Sorry, Psycho! Thanks Jessica! Yes ... an image linked to a URL rather than an image linked to another version of itself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.