<?
switch ($HTTP_GET_VARS['action']) {
case 'list':
$f = fopen("./liste.txt","r");
while(($file = fgets($f,100)) != false) {
$file = ereg_replace("\n","",$file);
if (!is_dir($file)&&$file!=='index.php') {?><a href="<?echo $file?>"><?echo $file?></a><br><?}
}
fclose($f);
break;
default:
$f = fopen("./liste.txt","r");
$count=0;
while(($file = fgets($f,100)) != false) {
$file = ereg_replace("\n","",$file);
if (!is_dir($file)&&$file!=='index.php') {
$count++;
$sig["$count"]=$file;
}
}
fclose($f);
$geh = $sig[rand(1,$count)];
Header('Content-type: image/jpeg');
Header('Pragma: No cache');
Header('Location: '.$geh);
}
?>