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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.