Rename simple upload file

Hi i have a simple triple upload file script that upload files with its own name it works fine but what i want is to be able to specify the name of the image like image what give file one give name (blue) file 2 name (tree) file 3 name (sky)

<?php
//set where you want to store files
//in this example we keep file in folder upload
//$HTTP_POST_FILES['ufile']['name']; = upload file name
//for example upload file name cartoon.gif . $path will be upload/cartoon.gif
$path1= "images/posters/".$_FILES['ufile']['name'][0];
$path2= "images/posters/".$_FILES['ufile']['name'][1];
$path3= "images/posters/".$_FILES['ufile']['name'][2];


//copy file to where you want to store file
copy($_FILES['ufile']['tmp_name'][0], $path1);
copy($_FILES['ufile']['tmp_name'][1], $path2);
copy($_FILES['ufile']['tmp_name'][2], $path3);

//$HTTP_POST_FILES['ufile']['name'] = file name
//$HTTP_POST_FILES['ufile']['size'] = file size
//$HTTP_POST_FILES['ufile']['type'] = type of file
echo "File Name :".$_FILES['ufile']['name'][0]."<BR/>";
echo "File Size :".$_FILES['ufile']['size'][0]."<BR/>";
echo "File Type :".$_FILES['ufile']['type'][0]."<BR/>";
echo "<img src=\\"$path1\\" width=\\"150\\" height=\\"150\\">";
echo "<P>";

echo "File Name :".$_FILES['ufile']['name'][1]."<BR/>";
echo "File Size :".$_FILES['ufile']['size'][1]."<BR/>";
echo "File Type :".$_FILES['ufile']['type'][1]."<BR/>";
echo "<img src=\\"$path2\\" width=\\"150\\" height=\\"150\\">";
echo "<P>";

echo "File Name :".$_FILES['ufile']['name'][2]."<BR/>";
echo "File Size :".$_FILES['ufile']['size'][2]."<BR/>";
echo "File Type :".$_FILES['ufile']['type'][2]."<BR/>";
echo "<img src=\\"$path3\\" width=\\"150\\" height=\\"150\\">";

///////////////////////////////////////////////////////

// Use this code to display the error or success.

$filesize1=$_FILES['ufile']['size'][0];
$filesize2=$_FILES['ufile']['size'][1];
$filesize3=$_FILES['ufile']['size'][2];

if($filesize1 && $filesize2 && $filesize3 != 0)
{
echo "We have recieved your files";
}

else {
echo "ERROR.....";
}

//////////////////////////////////////////////

// What files that have a problem? (if found)

if($filesize1==0) {
echo "There're something error in your first file";
echo "<BR />";
}

if($filesize2==0) {
echo "There're something error in your second file";
echo "<BR />";
}

if($filesize3==0) {
echo "There're something error in your third file";
echo "<BR />";
}

?>

Sorry found a mistake

if (!empty($errors)){

should be

if (empty($errors)){

Try this, i reduced the amount of code you had to a for loop which makes it easier to manage

<?php

// Set where you want to store files
// In this example we keep file in folder upload
// $HTTP_POST_FILES['ufile']['name']; = upload file name
// For example upload file name cartoon.gif . $path will be upload/cartoon.gif

$errors  = array();

$path    = 'images/posters/';
$name[0] = 'blue';
$name[1] = 'tree';
$name[2] = 'sky';

// Run through a loop
for($i=0; $i<count($_FILES['ufile']['name']); $i++){
    // Make sure the uploaded file exists
    if (isset($_FILES['ufile']['name'][$i]) && is_file($_FILES['ufile']['tmp_name'][$i])){
        $pathinfo  = pathinfo($_FILES['ufile']['name'][$i]);
        $file_name = $name[$i].'.'.$pathinfo['extension'];
        
        // Upload the file
        if (move_uploaded_file($_FILES['ufile']['tmp_name'][$i], $path.$file_name)){
            echo '<p>';
            echo 'File Name : '.$_FILES['ufile']['name'][$i].'<br />';
            echo 'File Size : '.$_FILES['ufile']['size'][$i].'<br />';
            echo 'File Type : '.$_FILES['ufile']['type'][$i].'<br />';
            echo '<img src="'.$path.$file_name.'" width="150" height="150" alt="" />';
            echo '</p>';
        } else {
            $errors[] = 'Failed to upload file no. '.($i+1);
        }
    } else {
        $errors[] = 'No file selected for file no. '.($i+1);
    }
}


///////////////////////////////////////////////////////

// Use this code to display the error or success.

if (!empty($errors)){
    echo 'We have recieved all your files!';
} else {
    echo 'We have recieved your files but an error has occurred!<br /><br />';
    
    foreach($errors as $error){
        echo $error.'<br />';
    }
}

?>