this is what i have so far but it uploads to the first location but not second.
where the second location prints the file name with a date.
thanks in advance.
Code:
$newname = dirname(__FILE__).'/upload'.$myvar;
$newcopy = dirname(__FILE__).'/copy'.$today.$myvar;
//Check if the file with the same name is already exists on the server
if (!file_exists($newname)) {
//Attempt to move the uploaded file to it's new place
if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'],$newname))) {
echo "It's done! The file has been saved as: ".$newname;
} else {
echo "Error: A problem occurred during file upload!<br>";
}
if ((move_uploaded_file($_FILES['uploaded_file']['tmp_name'],$newcopy))) {
echo "It's done! The file has been saved as: ".$newcopy;
} else {
echo "Error: A problem occurred during file upload!";
}
thanks in advance.
Comment