I'm trying to get image2 to have the same name as the first image but be placed in a different directory. I can get the first image to upload and have the name be md5 randomly, but can't get the second image to upload.
//Directory paths
$absolutepath = ABSOLUTE_PATH;
$absolutepath2 = ABSOLUTE_PATH2;
echo "Main 150x150 screenshot path: ".$absolutepath."<br /> Secondary 200x200 screenshot path: ".$absolutepath2;
//Start image upload
//Check for an image
$newname = md5(time()*rand(1,99999).$_FILES['image']['name']);
$newname2 = $newname.'.jpg';
if (move_uploaded_file ($_FILES['image']['tmp_name'], ABSOLUTE_PATH."$newname2")) {
echo '<p>Image uploaded</p>';
} else {
echo '<p>Problem uploading image</p>';
}
//Check for image2
if (move_uploaded_file ($_FILES['image']['tmp_name'], ABSOLUTE_PATH2."$newname2")) {
echo '<p>Image2 uploaded</p>';
} else {
echo '<p>Problem uploading image2</p>';
}