Published in: PHP
URL: http://www.purpleoak.co.uk
<?php // set the $folder to the folder containing the images // You then use <img src="/path/to/this/script.php" alt="image randomiser" /> // to display them $folder = 'banners'; $extList['gif'] = 'image/gif'; $extList['jpg'] = 'image/jpeg'; $extList['jpeg'] = 'image/jpeg'; $extList['png'] = 'image/png'; $img = null; $folder = $folder.'/'; } if ( ) { $img = $folder.$imageInfo['basename']; } } else { if ( ) { $fileList[] = $file; } } $img = $folder.$fileList[$imageNumber]; } } if ($img!=null) { $contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ]; } else { $im = @imagecreate (100, 100) $background_color = imagecolorallocate ($im, 255, 255, 255); $text_color = imagecolorallocate ($im, 0,0,0); imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color); imagepng ($im); imagedestroy($im); } } ?>
You need to login to post a comment.
