Salve ragazzi,
non riesco ad inserire delle foto in una carella specifica del server , questo è il mio codice:
<?
if ($img1_name != "") {
if (file_exists("foto_big/$img1_name"))
die ("ESISTE GIA' UN FILE CON LO STESSO NOME...SI PREGA DI RINOMINARE IL FILE");
copy("$img1", "foto_big/$img1_name")
or die("Impossibile copiare il file!");
} else {
die("File non specificato");
}
// find the image size
$imginfo = GetImageSize("foto_big/$img1_name");
if ($imginfo == NULL)
die ("ERRORE");
$srcWidth = $imginfo[0];
if ($srcWidth > 800){
$srcHeight = $imginfo[1];
$ratioWidth = $srcWidth/800;
$ratioHeight = 0;
$destWidth = 800;
$destHeight = $srcHeight / $ratioWidth;
// Resize the picture
exec("convert -quality 100 -antialias -sample \"".$destWidth."x".(int)$destHeight."\" \"foto_big/$img1_name\" \""."foto_big/1-"."$img1_name\"");
$nomefoto = "1-"."$img1_name";
unlink("foto_big/$img1_name");
}
else
$nomefoto = $img1_name ;
if ($img1_name != "") {
if (file_exists("foto_mini/$img1_name"))
die ("ESISTE GIA' UN FILE CON LO STESSO NOME...SI PREGA DI RINOMINARE IL FILE");
copy("$img1", "foto_mini/$img1_name")
or die("Impossibile copiare il file!");
} else {
die("File non specificato");
}
// find the image size
$imginfo = GetImageSize("foto_mini/$img1_name");
if ($imginfo == NULL)
die ("ERRORE");
$srcWidth = $imginfo[0];
if ($srcWidth > 200){
$srcHeight = $imginfo[1];
$ratioWidth = $srcWidth/200;
$ratioHeight = 0;
$destWidth = 200;
$destHeight = $srcHeight / $ratioWidth;
// Resize the picture
exec("convert -quality 100 -antialias -sample \"".$destWidth."x".(int)$destHeight."\" \"foto_mini/$img1_name\" \""."foto_mini/1-"."$img1_name\"");
$nomefotomini = "1-"."$img1_name";
unlink("foto_mini/$img1_name");
}
else
$nomefotomini = $img1_name ;
?>
nonostante inserisca l'immagine nel campo file "img1" mi dà "File non specificato"