It's morning there. Is it possible that I just forget a "," on my code but I did not see where the problem is.
Here is my html code:
<div class="col-sm-9 col-md-10 affix-content" id="addpress">
                <div class="container">
                    <div class="page-header">
                        <h3><span class="glyphicon glyphicon-th-list"></span> Ajouter une coupure de presse</h3>
                    </div>
                    <form method="POST" class="contact-form mid" action="forms.php">
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <input type="text" class="form-control" name="journal" autocomplete="off" id="journal" placeholder="Nom du journal" >
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <input type="text" class="form-control" name="date" autocomplete="off" id="date" placeholder="Date de parution">
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <input type="text" class="form-control" name="link" autocomplete="off" id="link" placeholder="Lien">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <input type="file" class="form-control" name="imgpress"  id="imgpress" >
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <button type="submit" class="btn main-btn pull-right" name="addpressform">Ajouter la coupure de presse</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
Here my php code:
if(isset($_POST['addpressform'])){
    $journal = htmlentities($_POST['journal']);
    $date = htmlentities($_POST['date']);
    $link = htmlentities($_POST['link']);
    if (!empty($_FILES)) {
    $mime_valid = ['image/png', 'image/jpeg','image/gif'];
    $extension_valid = ['png', 'jpeg','jpg','gif'];
    $extension = pathinfo($_FILES['imgpress']['name'])['extension'];
    $finfo = finfo_open(FILEINFO_MIME_TYPE);
    $mime = finfo_file($finfo, $_FILES['imgpress']['tmp_name']);
    if(in_array($extension, $extension_valid) && in_array($mime, $mime_valid)){
            $imgpress = $_FILES['imgpress']['name'];    
            if(move_uploaded_file($_FILES['imgpress']['tmp_name'], '../views/img/' . $imgpress)){
            echo"Le fichier à bien etais déplacer";
            }else{
                echo"Erreur dossier introuvable";
            }
        } else {
            echo 'Erreur de format';
        }
    }
    $new = array($imgpress, $link, $journal, $date);
    $query->insert("presse", $col=array("img", "link", "journal", "date"), $new);
    //header('Location: home.php#gererpresse');
}
When I submit my form I got this : Notice: Undefined variable: imgpress in C:\wamp64\www*******\forms.php on line 65
 
     
    