Julien L.
lundi 17 avril 2006 à 20:05
Votre hébèrgement supporte-t-il PHP ?
Les balises <?PHP (début du script) ?> (fin du script) sont-elles bien présentes ?
Le fichier est-il bien nommé 'nimportequoi
.php' ?
Auriez-vous une adresse pour voir le résultat ?
EDIT: Peut-être qu'ainsi ! Le répertoire était "hardcoded" dans le code d'affichage.
CODE
<?PHP
$repertoire='photos_galerie/veronique';
if ($handle = opendir($repertoire)) {
while (false !== ($x = readdir($handle))) {
if ($x != '.' && $x != '..' && eregi("([.]gif)|([.]jpg)|([.]png)|([.]tga)", $x)) {
$picsa[]=$x;
}
}
closedir($handle);
}
$pics = array_reverse($picsa);
if(count($pics)>0){
echo('<table id=\'pics\'><tr><td class=\'title\'>» pictures</td></tr><tr>');
$tr=0;
for($i=0; $i<count($pics); $i++){
echo('<td><a href=\''.$repertoire.'/'.$pics[$i].'\'><img src=\''.$repertoire.'/'.$pics[$i].'\' alt=\''.$pic[$i].'\' title=\''.$pic[$i].'\' /></a></td>');
$tr++;
if($tr > 5){ echo('</tr><tr>'); $tr=0; }
}
echo('</tr></table>');
}
?>