PDA

View Full Version : need help with code


desertdirk
11-23-2009, 11:09 PM
I am trying to fix code that someone else made on this website. Clicking on a thumbnail should display the image below the thumbnails, but regardless of which thumnail you click, the first image from the array always is displayed. Here is the web site:
http://plsnm.com/info.php?id=467&f=1239807849_offer_DSC02202.JPG

and the code:

if(!empty($a1[image]))
{

$ShowInfo .= "<table valign=top align=center height=50><tr>";

while(list(,$v) = each($im_array))
{


$ShowInfo .= "<td align=center valign=top width=\"50\" height=50><a href=\"info.php?id=$_GET[id]&f=$v\"><img src=\"re_images/$v\" width=50 height=50 border=0></a></td>";
}

$ShowInfo .= "</table><hr size=1 width=\"95%\" color=#336699><br>";


if(!empty($f))
{
$ShowInfo .= "<center><img src=\"re_images/$f\" height=480 width=640></center><br>";
}
else
{
$ShowInfo .= "<center><img src=\"re_images/$im_array[0]\" height=480 width=640></center><br>";
}

}
else
{
$ShowInfo .= "<br><center><img src=\"no_image.gif\"></center>";
}

edbr
11-23-2009, 11:43 PM
$_GET[id]&f=
i think that should be
$_GET[id]& $f=
else it is showing re_images/$im_array[0]\" which is the first part of the array

desertdirk
11-24-2009, 09:01 PM
thanks for the reply, but no that did not do it.
DD

edbr
11-24-2009, 11:25 PM
sorry it was a quick stab in the dark, if you echo $f so tou get a value returnred?

edbr
11-25-2009, 07:07 AM
here
while(list(,$v) = each($im_array)) the comma infront of $v