Ver Mensaje Individual
  #7 (permalink)  
Antiguo 10/09/2008, 04:09
Avatar de hawaiian050
hawaiian050
 
Fecha de Ingreso: junio-2007
Mensajes: 285
Antigüedad: 16 años, 10 meses
Puntos: 2
Respuesta: Mostrar imagen con php (.php?path=imagen.jpg)

imagen.php
Código PHP:
<?php


$gif   
'.gif';
$extencion strpos($_GET['imagen'], $gif);

if (
$extencion === false) {

Header("Content-type: image/jpeg"); 

$im imagecreatefromJpeg("$_GET[path]$_GET[imagen]");  // $_GET[path] o $_GET[imagen] o ambas ? 

ImageJpeg($im); 

ImageDestroy($im); 

} else {

Header("Content-type: image/gif"); 

$im imagecreatefromGif("$_GET[path]$_GET[imagen]");  // $_GET[path] o $_GET[imagen] o ambas ?

ImageGif($im); 

ImageDestroy($im); 

}



?>
Código HTML:
<img src="imagen.php?imagen=la_imagen.jpg" /> 
Saludos

Última edición por hawaiian050; 10/09/2008 a las 04:23