Fear my coding on your slow server! 
hehehe... waarom is de server nu zo traag als ik dit draai?
hehehe... waarom is de server nu zo traag als ik dit draai?
PHP:
1
| <?header("Refresh: 5;URL=random.php");?><HTML><BODY bgcolor=000000 text=FFFFFF><CENTER><?php$zut = getRandomImage("/");print "<font color=#FF0000 size=15 face=\"Verdana, Arial, Helvetica, sans-serif\">sabbi's rood aangelopen velletje wahwah";print "[img]\"$zut\"[/img]";function CheckDir($dir) { $images = array(); $handle = opendir("$dir"); // kijk of het een dir is, roep dan jezelf aan, anders check plaatje while (($part = readdir($handle))!=false) { if ($part != "." && $part != "..") { clearstatcache(); if ( is_dir($dir . "/" . $part)) { // roep de subber aan en flikker de zooi in images $images = array_merge ($images,CheckDir($dir . "/" . $part)); } elseif ( eregi("(gif|jpg|png|jpeg)$",$part) ) { $images[] = $dir . "/" . $part; } } } closedir($handle); return $images; }function getRandomImage($dir,$type='beertjes'){global $errors; if (is_dir($dir)) { // open de dir en bewonder hem, krijg de array trug $images = Checkdir($dir); // adding this in case you want to return the image array if ($type == 'all') { return $images; } // Be sure to call srand() once per script srand ((double) microtime() * 1000000); $key = rand (0,sizeof($images)-1); return $images[$key]; } else { $errors[] = $dir.' is not a directory'; return false; }}?> |