$file) {
                        if(is_uploaded_file($file['tmp_name'])){
                            $filename = preg_replace('/[^a-zA-Z0-9\-\._]/','', $file['name']);
                            $filesize = ($file['size'] < 1000000) ? round($file['size'] / 1000)."k" : round($file['size'] / 1000000)."M";
                            $title = $_POST['titles'][$index];
                            $path = '/docs/files/news';
                            move_uploaded_file($file['tmp_name'], "..$path/$filename");
                            $qf=mysqli_query($conn, "INSERT INTO files VALUES(null, '$title', '$filename', '".$path."', NOW(), '$filesize')");
                            $append[$index] = mysqli_insert_id($conn);
                        }
                    }
                }
                $q=mysqli_query($conn, "INSERT INTO news VALUES(null,
                                        '".addslashes(trim($_POST['title']))."', '".addslashes(trim($_POST['text']))."',
                                        '".trim(conv_date_en($_POST['date']))."','".implode(',',$append)."')");
                echo '
                        
                        Notizia aggiunta correttamente!