-----------------------------------------------------------------------------------------------------------------------------------------------------
error---
Warning: imagejpeg() [function.imagejpeg]: Unable to open 'ADLlk.jpg' for writing in /usr/home/apartmentc/domains/apartmentchiangmai.com/public_html/new/add_room_send.php on line 58
Warning: copy(ADLlk.jpg) [function.copy]: failed to open stream: No such file or directory in /usr/home/apartmentc/domains/apartmentchiangmai.com/public_html/new/add_room_send.php on line 59
--------------------------------------------------------------------------------------------------------------------------------------------------
code ----
//pic
for ($i=1; $i<=8; $i++){
$fileuploads[$i]=$_FILES["filepic$i"];
//echo $fileuploads[$i][tmp_name];
echo count($fileuploads[$i]);
}
for ($i=1; $i<=8; $i++){
if($fileuploads[$i][tmp_name]!=""){
$pic_tumb = htmlspecialchars($fileuploads[$i][tmp_name]);
$pic_file[$i] = random_password(5).".jpg";
$images = $fileuploads[$i][tmp_name];
$size = getimagesize($images);
$height=80;
$width=round($height*$size[0]/$size[1]);
$images_orig = imagecreatefromjpeg($images);
$photoX = imagesx($images_orig);
$photoY = imagesy($images_orig);
$images_fin = imagecreatetruecolor($width, $height);
imagecopyresampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
imagejpeg($images_fin,$pic_file[$i]); //error
copy($pic_file[$i], $path."resize_".$pic_file[$i]); //error
move_uploaded_file($pic_tumb, $path.$pic_file[$i]);
imagedestroy($images_orig);
imagedestroy($images_fin);
unlink($pic_file[$i]); //error
}
$sub=$pic_file{$i};
//insert picture
$sql="insert into picture_room(id,room_code,picture)values('','$code','$sub')";
$result=mysql_query($sql) or die("insert picture error");
}