phatgreenbuds Posted September 28, 2007 Share Posted September 28, 2007 Below is my code. There are two lines in the middle for the html img src=. The first is a database entry that holds the path to the thumbnail. I want to make that a link to the second which is another database entry holding the path to the actual image and have it open in a new window. Any suggestions how I would make that happen? <?php $query = "SELECT * FROM images"; $target = mysql_query($query); // uses the query variable defined above. confirm_query($target); // calls to the function file. while ($final_target = mysql_fetch_array($target)) { $submitter = "{$final_target["picsubmit"]}"; $description = "{$final_target["picdesc"]}"; $filename = "{$final_target["picfile"]}"; ?> <img src="<?php echo $final_target["tnpath"]; ?>" alt="" /> <br> <img src="<?php echo $final_target["picpath"]; ?>" alt="" /> <?php echo "<br>" . "<h4>" . $description . "</h4>" . "<br>"; echo "Submitted By: " . $submitter; echo "<h4>" . "<hr>" . "</h4>"; echo "<br>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/70987-solved-link-o-rama/ Share on other sites More sharing options...
pocobueno1388 Posted September 28, 2007 Share Posted September 28, 2007 <?php echo "<a href='{$final_target['picpath']}' target='blank'><img src='{$final_target['tnpath']}'></a>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/70987-solved-link-o-rama/#findComment-356929 Share on other sites More sharing options...
phatgreenbuds Posted September 28, 2007 Author Share Posted September 28, 2007 Good Grief...I am an idiot. Thank you...i can't believe it was that simple. Quote Link to comment https://forums.phpfreaks.com/topic/70987-solved-link-o-rama/#findComment-356934 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.