Ver Mensaje Individual
  #9 (permalink)  
Antiguo 06/03/2009, 09:18
Avatar de ..::MaRcOs::..
..::MaRcOs::..
 
Fecha de Ingreso: diciembre-2006
Mensajes: 328
Antigüedad: 17 años, 4 meses
Puntos: 3
Respuesta: Editar imagenes al momento de subirlas

intente de esta otra forma y tampoco

Código PHP:
<?php
//datos de conexion a mysql

if(!isset($_FILES[foto])){
echo
'
<form enctype="multipart/form-data" method="post" action="">
<input name="foto" type="file" size="35" /><br />
<input type="submit" name="button" id="button" value="subir" />
</form>'
;
}else{

$binario_nombre_temporal=$_FILES['foto']['tmp_name'] ;
$binario_contenido addslashes(fread(fopen($binario_nombre_temporal"rb"), filesize($binario_nombre_temporal)));

$img imagecreatefromstring($binario_contenido);    
$picsize 20;
$new_w imagesx($img);
$new_h imagesy($img);
$aspect_ratio $new_h $new_w;
$new_w $picsize;
$new_h abs($new_w $aspect_ratio);
$dst_img ImageCreateTrueColor($new_w,$new_h);
$fotico imagecopyresampled($dst_img,$img,0,0,0,0,$new_w,$new_h,imagesx($img),imagesy($img));  
$fotico imagejpeg($dst_img,'',90);

$consulta_insertar "INSERT INTO albumes (imagen) VALUES ('$fotico')";
mysql_query($consulta_insertar,$conexion);
}
?>