Bonjour,
Voici mon code dans mon premier fichier :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <?php require_once("connect_db.php"); ?>
...
<form action="mon deuxieme fichier" method="post" enctype="multipart/form-data"><form action="inserer_bonplan_restauration.php" method="post" enctype="multipart/form-data">
...
<input type="hidden" name="MAX_FILE_SIZE" value="128000"/>
<tr>
<td> Photo 1 : </td>
<td> <input type="file" name="fichier1"/> </td>
</tr>
<tr>
<td> Photo 2 : </td>
<td> <input type="file" name="fichier2"/> </td>
</tr>
<tr>
<td> Photo 3 : </td>
<td> <input type="file" name="fichier3"/> </td>
<td> <input type="submit" name="submitButton" value=" OK "/> </td>
</tr>
...
Mon deuxième fichier :
<?php require_once("connect_db.php"); ?>
...
<?php
$sql="INSERT INTO ... (..., photo_1, photo_2, photo_3) VALUES (..., '', '', '');";
$resultat=qdb($sql);
$dernier_id= mysql_insert_id();
$uploadfile = "pas_de_photo.jpg";
if(!empty($_FILES['fichier1']))
{...}
else{ echo "pas de fichier spécifié";} |
Lorsque je rentre un fichier, la page m'affiche "pas de fichier spécifié".
J'ai fait cet affichage :
<pre><?php print_r($_FILES); ?></pre>
qui me retourne :
Array
(
[fichier1] => Array
(
[name] => Tulips.jpg
[type] =>
[tmp_name] =>
[error] => 2
[size] => 0
)
...
Je ne comprends pas pourquoi il ne prend pas en compte le type du fichier, ni la taille et quelles sont les deux erreurs ?
Merci
Partager