sto avendo un problema con un upload di file ecco il code:
HTML
codice:
<form name="formnewstar" enctype="multipart/form-data" method="post" action="page/savenewstar.php">
<input id="fileimage" name="fileimage" type="file" size="50">
Codice PHP:
//qui da l'errore
$tmpimg=$_FILES["fileimage"]["tmp_name"];
if($tmpimg){
$direcotry="../images/msg/$idmsg/";
mkdir($direcotry,755,true);
$nameimage=$_FILES["image"]["name"];
list($width,$height) = getimagesize($tmpimg);
$newH=(150 / ($width / $height));
$thumb=imagecreatetruecolor(150, $newH);
$source = imagecreatefromjpeg($tmpimg);
imagecopyresized($thumb, $source, 0, 0, 0, 0, 150, $newH, $width, $height);
// Salvo l'immagine ridimensionata
imagejpeg($thumb, $direcotry.$nameimage, 80);
}
mi da questi 2 errori:
Notice: Undefined index: image
Warning: imagejpeg() [function.imagejpeg]: Unable to open '../images/msg/heckmhhhkx/' for writing: No such file or directory