<?php mysql_query("INSERT INTO annonces (ref_annonce_client, id_reg, id_dep, id_cat, email, password, ville, code_pos, status, soc_nom, soc_siren, type, nom, tel, titre, radio, ann, prix, Kilométrage, Année_Modéle, Cylindrée, Surface, Piéces, Capacité, random_code, confirm, valid, date, tel_cache, ip, url_pho1, url_pho2 ,url_pho3 , url_pho4, url_pho5 )VALUES('$ref', '$re', LEFT('$de',2), '$Typeann', '$mail ', '$password', '$vil', '$cod', '$sta', '$nom', '', '1', '$nom', '$telag', '$titre', '$ra', '$desc', '$pri', '', '', '', '$surf', '$nbpiece', '', '$rand', '$conf', '$val', '$time', 'N', '$ipadresse', '$pho1', '$pho2', '$pho3', '$pho4', '$pho5')"); $sql1 = "SELECT id_for FROM form WHERE id_cat='$Typeann' ORDER BY id_for"; $sql2 = "SELECT id_ann FROM annonces WHERE ref_annonce_client='$ref'"; $sql3 = "SELECT id_for FROM form WHERE id_cat='$Typeann' ORDER BY id_for DESC"; $query1 = @mysql_query($sql1); $query2 = @mysql_query($sql2); $query3 = @mysql_query($sql3); $id_for1 = result_to_array($query1); $id_annform = result_to_array($query2); $id_for2 = result_to_array($query3); mysql_query("INSERT INTO valeurs (id_val, id_for, id_ann, val_for ) VALUES ( '', '$id_for1', '$id_annform', '$surf' )"); mysql_query("INSERT INTO valeurs (id_val, id_for, id_ann, val_for ) VALUES ( '', '$id_for2', '$id_annform', '$nbpiece' )") or die("Erreur MySQL : ".mysql_error()); var_dump($id_for1[0]); echo $id_for1; print " "; var_dump($id_annform[0]); echo $id_annform; print " "; var_dump($id_for2[0]); echo $id_for2; print " <hr>"; ?>
$dir= "/homez.194/touslesb/www/ftpclient/wizzimmo"; $dh = opendir($dir); while ($file = readdir($dh)) { echo "fichier : "; var_dump($file);
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionwhile ($file = readdir($dh))
/* Ceci est la façon correcte de traverser un dossier. */ while (false !($file readdir($handle))) { echo "$file\n"; } /* Ceci est la MAUVAISE façon de traverser un dossier. */ while ($file = readdir($handle)) { echo "$file\n"; }
<?php $dir = "/homez..../.../.../.../dossier"; if($dh = opendir($dir)) { $count=0; while (false !($file readdir($dh))) { if ($file != "." && $file != ".."){$count++; $adressefile = $dir."/".$file; ////votre script en utilisant "$file" pour appeler vos fichiers }} } closedir($dh); ?>