enregistrement photo dans base de donnée
Posté : 26 oct. 2024, 15:35
Bonjour, voici la réponse que j'ai après ce bout de code. J'ai été sur le web et apparemment c'est un problème de permission ????. Quelqu'un a une idée.
Warning: move_uploaded_file(): The second argument to copy() function cannot be a directory in C:\xampp\htdocs\tableaux\ajout_image.php on line 17
Warning: move_uploaded_file(): The second argument to copy() function cannot be a directory in C:\xampp\htdocs\tableaux\ajout_image.php on line 17
if (isset($_POST["ajouter"])) {
$nom = $_POST["nom"];
$description = $_POST["description"];
$img = $_FILES["img"]["name"];
if (is_dir('./dossier_image/')) {
echo 'Le dossier existe';
} else {
echo 'Le dossier n\'existe pas';
}
$upload = './dossier_image/';
move_uploaded_file($_FILES["img"]["tmp_name"], $upload);
echo "je suis dans le isset";
$sql = "INSERT INTO imaget (img_yt,nom_yt,description_yt)VALUES('$img','$nom','$description')";
}