phpnoobie9 Posted April 4, 2008 Share Posted April 4, 2008 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>'; } Quote Link to comment Share on other sites More sharing options...
phpnoobie9 Posted April 4, 2008 Author Share Posted April 4, 2008 Got it...missed the name on $_FILES. Thanks for looking. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.