Jump to content

[SOLVED] Link-o-rama


phatgreenbuds

Recommended Posts

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>";
	} 	
?>

Link to comment
https://forums.phpfreaks.com/topic/70987-solved-link-o-rama/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.