Jump to content

Adding A HREF to PHP Page to display image from thumbnail


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

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.