Valeur input file

Résolu
cs_chamallow Messages postés 363 Date d'inscription mercredi 18 mai 2005 Statut Membre Dernière intervention 29 janvier 2007 - 28 avril 2006 à 11:54
cs_chamallow Messages postés 363 Date d'inscription mercredi 18 mai 2005 Statut Membre Dernière intervention 29 janvier 2007 - 28 avril 2006 à 13:33
Bon, ce matin je dois vraiment le faire exprès c'est pas possible grrrrr

Voilà je fais un formulaire tout bete pour un upload pour mes tests :
<html>
        <head>
        </head>
       
                <form action = "essaiFtp2.php" method="post">
                Votre fichier :

               
               
       
</html>

Et le petit traitement sur le même fichier :
<?
    if(isset($_POST['Envoyer']))
    {
        echo "nom : ".$_FILES["mon_fichier"]['name'];
    }
?>

Bon ben là il m'affiche pas le nom du fichier Pourquoi?? C'est bien comme ça que ça marche non?? Si je fais $_POST['mon_fichier'], alors il m'affiche tout le chemin jusqu'au fichier (normal), mais $_FILES marche pas (alors que normalement ça sert à récupérer juste le nom !)

Merci de votre aire

3 réponses

cs_Anthomicro Messages postés 9433 Date d'inscription mardi 9 octobre 2001 Statut Membre Dernière intervention 13 avril 2007 8
28 avril 2006 à 13:05
Salut,

<? ===> <?php

ensuite tu fais du code html crade, il y a des balises non fermées, du code manquant etc...

<form action="essaiFtp2.php" method="post" enctype="multipart/form-data">
    <label>Votre fichier : </label>

   

</form>

<hr size="2" width="100%"><li>Entraide, dépannage et vulgarisation informatique : Mon site de vulgarisation informatique</li><li>Codes-php.net</li>
3
cs_chamallow Messages postés 363 Date d'inscription mercredi 18 mai 2005 Statut Membre Dernière intervention 29 janvier 2007 1
28 avril 2006 à 13:31
Ouais ben le code html crade c'était juste pour tester parce que ca m'énervait, et sache que je l'ai fait en HTML propre juste avant et ça avait pas marché (ce morceau là je l'ai piqué sur un site parce que ça m'étonnait que ce que j'avais fait marchait po!)
0
cs_chamallow Messages postés 363 Date d'inscription mercredi 18 mai 2005 Statut Membre Dernière intervention 29 janvier 2007 1
28 avril 2006 à 13:33
Ah au fait, merci quand même.

Le truc important que j'avais oublié : enctype="multipart/form-data"
0
Rejoignez-nous