Jump to content

Adding A HREF to PHP Page to display image from thumbnail


AlanW

Recommended Posts

I have a site that I am struggling to get it to do what I need it to! I have managed to change how many photos appear but I cannot add A HREF links around these thumbnails to get a larger picture to appear in browser window. Code is below - all help appreciated. ( I want the 100X100 images to be clickable and show full size in another window)

Thanks in advance for any help

 

 

if(!empty($a1[image]))	{		$im_array = explode("|", $a1[image]); 		$FirstImage = "<img src=\"re_images/$im_array[0]\" width=100 height=100 border=1>"; 		$SecondImage = "<img src=\"re_images/$im_array[1]\" width=100 height=100 border=1>"; 		$ThirdImage = "<img src=\"re_images/$im_array[2]\" width=100 height=100 border=1>"; 		$FourthImage = "<img src=\"re_images/$im_array[3]\" width=100 height=100 border=1>"; 		$FifthImage = "<img src=\"re_images/$im_array[4]\" width=100 height=100 border=1>"; 		$SixthImage = "<img src=\"re_images/$im_array[5]\" width=100 height=100 border=1>"; 	}  	$ShowInfo .= "</td>\n\t<td align=center valign=top>$FirstImage<br>$SecondImage<br>$ThirdImage<br>$FourthImage<br>$FifthImage<br>$SixthImage<br>For more information call<br><b> $a1[FirstName] $a1[LastName]<br>$a1[phone]</b><br>or click <a class=RedLink href=\"email.php?AgentID=$a1[AgentID]&ListingID=$a1[listingID]\">here</a> to email.<center>";  	$ShowInfo .= "</center></td>\n</tr>";if(!empty($a1[image]))
{
	$im_array = explode("|", $a1[image]);

	$FirstImage = "<img src=\"re_images/$im_array[0]\" width=100 height=100 border=1>";

	$SecondImage = "<img src=\"re_images/$im_array[1]\" width=100 height=100 border=1>";

	$ThirdImage = "<img src=\"re_images/$im_array[2]\" width=100 height=100 border=1>";

	$FourthImage = "<img src=\"re_images/$im_array[3]\" width=100 height=100 border=1>";

	$FifthImage = "<img src=\"re_images/$im_array[4]\" width=100 height=100 border=1>";

	$SixthImage = "<img src=\"re_images/$im_array[5]\" width=100 height=100 border=1>";

}


$ShowInfo .= "</td>\n\t<td align=center valign=top>$FirstImage<br>$SecondImage<br>$ThirdImage<br>$FourthImage<br>$FifthImage<br>$SixthImage<br>For more information call<br><b> $a1[FirstName] $a1[LastName]<br>$a1[phone]</b><br>or click <a class=RedLink href=\"email.php?AgentID=$a1[AgentID]&ListingID=$a1[listingID]\">here</a> to email.<center>";


$ShowInfo .= "</center></td>\n</tr>";

You could add an onclick event to each item that runs the javascript window.open function to open you new image window. You can even control its appearance with that function.

http://www.w3schools.com/js/tryit.asp?filename=tryjs_openallwindow

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.