Hello!

I have a basic script that allows me to upload multiple files to my server - yay!

Now, I'd like to be able to associate a variable with the input element that holds the image.

Dream world would be storing $imgnumber = "9"; in my loop if I upload an image to the image_9 field.

Here is a sample of the HTML code:
HTML Code:
<input id="image_9" name="images[]" type="file"  />	
	<input id="image_11" name="images[]" type="file"  />
Here is a sample of the PHP code:
PHP Code:
if (isset($_POST['Submit'])) {
    
$number_of_file_fields 0;
    
$number_of_uploaded_files 0;
    
$number_of_moved_files 0;
    
$uploaded_files = array();
    
$upload_directory dirname(__file__) . '/uploaded/'//set upload directory
    /**
     * we get a $_FILES['images'] array ,
     * we process this array while iterating with simple for loop
     * you can check this array by print_r($_FILES['images']);
     */
    
for ($i 0$i count($_FILES['images']['name']); $i++) {
        
$number_of_file_fields++;
        if (
$_FILES['images']['name'][$i] != '') { //check if file field empty or not
            
$number_of_uploaded_files++;
            
$uploaded_files[] = $_FILES['images']['name'][$i];
            if (
move_uploaded_file($_FILES['images']['tmp_name'][$i], $upload_directory $_FILES['images']['name'][$i])) {
                
$number_of_moved_files++;
                
// $varnumber = FORM_ELEMENT_ID
            
}
 
        }
 
    }
    echo 
"Number of File fields created $number_of_file_fields.<br/> ";
    echo 
"Number of files submitted $number_of_uploaded_files . <br/>";
    echo 
"Number of successfully moved files $number_of_moved_files . <br/>";
    echo 
"File Names are <br/>" implode(','$uploaded_files);

Many thanks for any pointers here :-D