Hello Friends,

I am getting the following error:

Strict Standards: Only variables should be passed by reference in the function FileUpload()

The function FileUpload() as follows:

PHP Code:
function FileUpload($FieldName 'File' ,$UploadFolder '' $allowed_ext=''){        
    if(
$FieldName != ""){    
        
$name $_FILES[$FieldName]['name']; 
        
$ext strtolower(end(explode(".",$name)));
        
$type $_FILES[$FieldName]['type'];
        
$size $_FILES[$FieldName]['size']; // in bytes
        
$size = ($size/1024)/1024// in mb
        
$error $_FILES[$FieldName]['error'];
        
$tmp_name $_FILES[$FieldName]['tmp_name'];
        
        
//$allowed_type = array('images/jpeg', 'images/pjpeg' , 'images/gif' , 'images/bmp' , 'images/jpg');
        
        
$allowed_ext = array('jpeg' 'jpg' 'bmp' 'gif' 'doc' 'docx' 'pdf' 'txt' 'zip' 'rar');
        
        
$UploadDir '';
        
        if(
$name != ''){
        
        if(
$error == ''){
            
//in_array($type , $allowed_type) &&
            
if(in_array($ext $allowed_ext)){
                if(
$size <=8){
                    if(
$UploadFolder != ""){
                        if(!
is_dir($UploadFolder)){
                            
mkdir($UploadFolder 0777);    
                        }
                        
$UploadDir $UploadFolder;
                    }else{
                        
$UploadDir 'uploads';
                    }
                    
$new_filename time()."--".$name;
                    
$IsUploaded move_uploaded_file($tmp_name $UploadDir."/".$new_filename);
                    if(
$IsUploaded){
                        return 
$UploadDir."/".$new_filename;
                    }else{                    
                        
$_SESSION['UploadError'] = "File can not be uploaded , please try again.";
                        return 
false;
                    }
                }else{
                    
$_SESSION['UploadError'] = "File size must be under 8mb";                
                    return 
false;
                }
            }else{            
                
$_SESSION['UploadError'] = "Only ".implode(", ",$allowed_ext)." files are allowed";    
                return 
false;
            }
        }else{
            
            
$_SESSION['UploadError'] = $error;
            return 
false;
        }
        }else{        
            
$_SESSION['UploadError'] = 'You have not select any file to upload.';
            return 
false;
        }
    }    

Kindly help me to solve this error.

Thank you