I can't get this to work -> Image Randomizer Can someone please tell me why?
Here is MY HTML FILE
Here is how I configure the script
PHP:--------------------------------------------------------------------------------
<?php
/*
Copyright (c) 2002 Hiveware. All Rights Reserved.
Hiveware makes no representations or warranties about
the suitability of the software, either express or
implied, including but not limited to the implied
warranties of merchantability, fitness for a particular
purpose, or non-infringement. Hiveware shall not be
liable for any damages suffered by licensee as a
result of using, modifying or distributing this
software or its derivatives.
*/
// Modify the following line before using this script
$folder = "/www/a/angiebro/htdocs/blog/photos/05";
$fileList = array();
$handle = opendir($folder);
while (false !== ($file = readdir($handle) ) ) {
if ( substr($file, -4) == ".gif" || substr($file, -4) == ".jpg" ) {
$fileList[count($fileList)] = $file;
}
}
closedir($handle);
$randNum = rand( 0, (sizeOf($fileList) -1) );
if ( substr($fileList[$randNum], -4) == ".gif" ) {
header ("Content-type: image/gif");
} elseif ( substr($fileList[$randNum], -4) == ".jpg" ) {
header ("Content-type: image/jpeg");
}
readfile($fileList[$randNum]);
?>