Hello, I've got this code for my pictures when they are being uploaded, but I have a problem. I want to be able to create a thumbnail with the size 125*180 for every picture and name them their filename but like this "thumb_filename.jpg" etc.
I have searched on google and found some scripts but I don't seem to be able to implement it with my script. Could anybody be very kind and help me with this as I am kinda new to PHP and I have been looking for answers for weeks :)
$filename[0];$filename[1];$filename[2];$filename[3];$filename[4];$filename[5];
for($i = 0; $i < $images; $i++)
{
$saveFolder = "uploads/theBulletin/products/";
if ((($_FILES["file".$i]["type"] == "image/gif")
|| ($_FILES["file".$i]["type"] == "image/jpeg")
|| ($_FILES["file".$i]["type"] == "image/pjpeg")
|| ($_FILES["file".$i]["type"] == "image/png")
|| ($_FILES["file".$i]["type"] == "image/bmp")))
{
$ext; if($_FILES["file".$i]["type"] == "image/gif"){ $ext = "gif";}
else if(($_FILES["file".$i]["type"] == "image/jpeg") || ($_FILES["file".$i]["type"] == "image/pjpeg")){ $ext = "jpg";}
else if($_FILES["file".$i]["type"] == "image/png"){ $ext = "png";}
else if($_FILES["file".$i]["type"] == "image/png"){ $ext = "bmp";}
$filename[$i] = rand().rand().rand().rand().rand().rand().".".$ext;
if ($_FILES["file".$i]["error"] > 0){}
else
{
if (file_exists($saveFolder . $filename[$i]))
{
}
else
{
move_uploaded_file($_FILES["file".$i]["tmp_name"],$saveFolder . $filename[$i]);
}
}
}
}
Thanks in advance
Regards,
Mike