![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
22/08/2009, 11:24
|
| | Fecha de Ingreso: octubre-2008 Ubicación: Andalucia
Mensajes: 23
Antigüedad: 16 años, 3 meses Puntos: 0 | |
Problema creando miniaturas de imagenes El problema no es crear las miniaturas, las miniaturas las crea el problema me viene con el Código PHP: move_uploaded_file
. Hace solo el primero de los 2 que tiene que hacer. Aqui les dejo el codigo, alguien me puede ayudar. Cita: <?php
include_once("conexion.php");
$dbh=conectar();
$id= $_REQUEST['id'];
$nombre=$_REQUEST['nombre'];
$fecha=$_REQUEST['fecha'];
if( $nombre==""){
header ("Location: inser_image.php");
}else{
if(isset($_FILES['archivo'])){
$imagen= $_FILES['archivo']['name'];
//Creacion de la miniatura
$filename= $_FILES['archivo']['tmp_name'];
// Resample
$image_p = imagecreatetruecolor(150, 150);
$image = imagecreatefromjpeg($filename);
list($width_orig, $height_orig) = getimagesize($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 150, 150, $width_orig, $height_orig);
// Output
imagejpeg($image_p, $filename, 100);
move_uploaded_file($_FILES['archivo']['tmp_name'], "../images/galeria/".$_FILES['archivo']['name']);
move_uploaded_file($filename, "../images/galeria/thumbs/".$filename);
$sql="insert into imagenes (imagen_id,nombre, fecha, imagen) values ('$id','$nombre', '$fecha', '$imagen')";
$dbh->query($sql);
}
try{
}catch (PDOException $e){
echo "Error de desconexion: ". $e->GetMessage();
}
header("Location: menu_doc_image.php");
}
?> |