while(false !== ($fichier = readdir($rep)))
{
if ($fichier != "." && $fichier != ".." && is_dir($url.$fichier))
{
$dname[] = $fichier;
sort($dname);
reset ($dname);
}
}while(false !== ($fichier = readdir($rep)))
{
if ($fichier != "." && $fichier != ".." && is_dir($url.$fichier))
{
$dname[] = $fichier;
sort($dname);
reset ($dname);
}
}Code : Tout sélectionner
function galerie ($a) {
$r = (isset($_GET['r']))?$_GET['r']:"";
$c = (isset($_GET['c']))?$_GET['c']:"";
$car_forbid = array('.','/');
$r = str_replace($car_forbid, "", $r);
$c = str_replace($car_forbid, "", $c);
$url = "/homepages/21/xxxxxxx/htdocs/lesite/galerie/".$r."/" ;
$rep=opendir($url);
$d=$c;
$a=$url .'/' . $c;
$dimg=opendir($a);
while(false !== ($fichier = readdir($rep)))
{
if ($fichier != "." && $fichier != ".." && is_dir($fichier))
{
$dname[] = $fichier;
sort($dname);
reset ($dname);
}
}
Code : Tout sélectionner
<select onChange="location = this.options[this.selectedIndex].value;">
<option>----------</option>
<?
$u=0;
foreach($dname as $key=>$val) {
if($dname[$u]){
print " \t\t\t<option value=\"?o=galerietest&r=" . $r . "&c=" . $dname[$u] . "\">" . $dname[$u] . "</option>\n";
$u++;
}
}
?>
</select>