Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/10/2011, 16:51
nico_elpocholo
 
Fecha de Ingreso: octubre-2009
Mensajes: 40
Antigüedad: 14 años, 6 meses
Puntos: 0
Respuesta: Problema con imagen

Código PHP:
Ver original
  1. <?php
  2. $id = reemplazar_comillas($_GET['id']);
  3. $avatar = avatar_a($id);
  4. redimensionar_a($avatar['url']);
  5. ?>

Las funciones:

Código PHP:
Ver original
  1. <?php
  2. function avatar_a($id)
  3. {
  4.     $a = mysql_query("select url,u_id from u_avatares where u_id='$id'");
  5.     $avatar = mysql_fetch_array($a);
  6.     return $avatar;
  7. }
  8. ?>

Código PHP:
Ver original
  1. <?php
  2. function redimensionar_a($img)
  3. {
  4.     $datos = GetImageSize($img);
  5.     $xp = $datos[0];
  6.     $yp = $datos[1];
  7.     if($xp > $yp)
  8.     {
  9.         echo '<img src="'.$img.'" width="300px" />';
  10.     }
  11.     else
  12.     {
  13.         echo '<img src="'.$img.'" height="300px" />';
  14.     }
  15. }
  16. ?>