<?php $allowed_mimes=array("image/jpeg","image/gif","image/png"); $dirPath = "./"; $imglist = array(); if ($handle = opendir($dirPath)) { while (false !== ($file = readdir($handle))) { $imageinfo = @getimagesize($file); if(in_array($imageinfo["mime"], $allowed_mimes)) $imglist[] = $file; } closedir($handle); } $rand = rand(0,count($imglist)-1); $file = $imglist[$rand]; $imageinfo = @getimagesize($file); switch($imageinfo["mime"]) { case "image/jpeg": $image = imagecreatefromjpeg($file); header("Content-type: image/jpeg"); imagejpeg($image); break; case "image/gif": $image = imagecreatefromgif($file); header("Content-type: image/gif"); imagegif($image); break; case "image/png": $image = imagecreatefrompng($file); imagealphablending($image,false); imagesavealpha($image,true); header("Content-type: image/png"); imagepng($image); break; } imagedestroy($image); ?>
Archive for January, 2009
WP-Syntax Test
Exec-PHP Test
This text is generated with a php echo statement.
Framework
Currently testing out a theme framework I’m developing. Hopefully when I’m finished it will be simple enough to style with ease but still look good with no modifications.





