1. read()) !== false) { if(strpos($entry, '.png') !== false) { $images[] = $entry; } } $rand_image = $images[rand(0, count($images) - 1)]; header("Content-type: image/png"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); readfile($rand_image); ?> 2. read()) !== false) { if (strlen($entry) <= 4) continue; $a = strtolower(substr($entry,-4)); if ($a == '.gif' || $a == '.jpg' || $a == 'jpeg' || $a == '.png') $files[] = $entry; } $d->close(); sort($files); if (!isset($_SERVER['HTTP_REFERER'])) $_SERVER['HTTP_REFERER'] = ''; $x = $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_REFERER'] . date('i'); $a = 0; $i = strlen($x); while ($i--) { $a += $i * ord(substr($x,$i,1)); } srand($a); $fn = $files[rand() % count($files)]; if ($shouldredirect) { header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/" . $fn); } else { $a = strtolower(substr($fn,-4)); if ($a == '.gif') header("Content-Type: image/gif"); else if ($a == '.png') header("Content-Type: image/png"); else header("Content-Type: image/jpeg"); header("Content-Length: " . filesize($fn)); readfile($fn); } ?> 3.