prepare('INSERT INTO photospolo (nomphoto) VALUES (:nom)'); $requête->execute(array('nom' => $nom)); $requête->closeCursor(); // changer le nom de la photo sélectionnée dans le fichier photo.txt $fichier = fopen('photo.txt','r+'); ftruncate($fichier,0); // évite les problèmes quand on change pour un nom plus court fputs($fichier, $nom); fseek($fichier, 0); fclose($fichier); header('Location: ../administration.php?modifphoto=4'); // succès, move_uploaded_file renvoie la valeur TRUE exit (); } else // echec à l'enregistrement, la fonction renvoie FALSE { header('Location: ../administration.php?modifphoto=3'); exit (); } } else // mauvais format { header('Location: ../administration.php?modifphoto=2'); exit (); } } else // mauvaise taille { header('Location: ../administration.php?modifphoto=1'); exit (); } ?>