Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/05/2005, 14:36
Facha
 
Fecha de Ingreso: marzo-2005
Mensajes: 90
Antigüedad: 19 años
Puntos: 0
cambio de imagen

tengo el siguiente codigo que me genera una tabla con imagenes tomadas de una base. necesito aque una vez seleccionada cualquiera de las imagenes, esta quede resaltada, pero cuando seleccione otra, la anterior debe volver a su estado primario(o sea avtiva y sin resalte), como lo puedo solucionar

<?PHP
include("conexion.php");
$codid=$_GET['id'];
$codfoto=$_GET['cod'];

$SQL= "SELECT * FROM categorias WHERE catid=".$codid;
$resultado=mySQL_query($SQL)or die("Error de consulta: ".$SQL);
$registro=mySQL_fetch_array($resultado);
$SQL2= "SELECT * FROM productos WHERE catid=".$codid;
$resultado2=mySQL_query($SQL2)or die("Error de consulta: ".$SQL2);
$registro2=mySQL_fetch_array($resultado2);
$SQL3= "SELECT * FROM productos WHERE idprod=".$codfoto;
$resultado3=mySQL_query($SQL3)or die("Error de consulta: ".$SQL3.mySQL_error());
$registro3=mySQL_fetch_array($resultado3);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Grilla</title>
<link href="classes_menu.css" rel="stylesheet" type="text/css">
</head>
<body style="padding-left:5px;" class="scrollsDiv">
<?PHP
echo"<table width=\"216\" border=\"0\" align=\"left\" cellpadding=\"3\" cellspacing=\"3\">";
$contador = 0;
echo "<tr width=\"300\">";
while($registro2=mySQL_fetch_array($resultado2)){
$contador+=1;
if($codid==1){
echo "<td><a href=\"detalle.php?id=$registro2[catid]&cod=$registro2[idprod]\" target=\"rightFrame\"><img src= \"imagenes/imagenes_Optimizadas/moderno/chicas/$registro2[fotochica]\" width=\"54\" height=\"48\" style=\"border-color:#828282;\"></a></td>";
if($contador==4){
echo "</tr><tr>";
$contador=0;
}
}
if($codid==2){
echo "<td><a href=\"detalle.php?id=$registro2[catid]&cod=$registro2[idprod]\" target=\"rightFrame\"><img src= \"imagenes/imagenes_Optimizadas/clasico/chicas/$registro2[fotochica]\" width=\"54\" height=\"48\" style=\"border-color:#828282;\"></a></td>";
if($contador==4){
echo "</tr><tr>";
$contador=0;
}
}
if($codid==3){
echo "<td><a href=\"detalle.php?id=$registro2[catid]&cod=$registro2[idprod]\" target=\"rightFrame\"><img src= \"imagenes/imagenes_Optimizadas/rustico/chicas/$registro2[fotochica]\" width=\"54\" height=\"48\" style=\"border-color:#828282;\"></a></td>";
if($contador==4){
echo "</tr><tr>";
$contador=0;
}
}
}
mysql_free_result($resultado2);

echo"</table>";
?>
</body>
</html>