Récupération de variable dans un Formulaire
Bonsoir
Code:
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
| $nom = $nom['userfile']['name'][0] ;
$tableau = $_FILES;
foreach ($tableau as $key=>$nom)
$tableau = array();
$tableau['name'] = array();
$tableau['userfile'] = array();
$tableau['userfile']['name'] = array();
$tableau['userfile']['type'] = array();
$tableau['userfile']['tmp_name'] = array();
$tableau['userfile']['size'] = array();
$tableau['userfile']['error'] = array();
//===============================================================================
// TRAITEMENT DU FORMULAIRE
//===============================================================================
if(isset($_POST['valider'])){
//===============================================================================
//
// ENREGISTREMENT DU CHEMIN ET NOM DANS LA TABLE IMAGE
//
//===============================================================================
include "../connect/mabrique-connect.php";
//echo $sql = "INSERT INTO images (chem_pho_1, pho_1) values ('".$finaldir."','".$name."')";
//$insert = mysql_query($sql) or die (mysql_error());
for($x=1;$x<=$maxfiles;$x++)
echo $sql = "INSERT INTO images (chem_pho_1, pho_1) values ('".$finaldir."','".$nom."')";
$insert = mysql_query($sql) or die (mysql_error()); |
Voilà je voudrais faire un INSERT mais je n'arrive pas à récupérée le nom du fichier 'usefile[]'
QUi pourrais me donner une solution ?
Merci