View Single Post
Old 10-14-2003, 12:43 PM   #6 (permalink)
Halx
Please touch this.
 
Halx's Avatar
 
Owner/Admin
Location: Manhattan
I made some changes.... now it creates the image list automatically

PHP Code:
<?

    $path = "/home/wherever/your/files/are/located/";


    while($entryName = readdir($path)) {
      if (preg_match("(.jpg|.gif|.jpeg|.png)",$entryName)) { // the the current file is an image
        $images[] = $entryName; //get the file names
      }
    }
    closedir($path);

    $x = rand( 0, ( count( $images ) - 1 ) );

    $tehfile = readfile( $path . $images[$x] );

    header( "Content-type: image/jpeg" );
    header( "Content-Disposition: inline; filename=" . $images[$x] );

    return $tehfile;

?>
__________________
You have found this post informative.
-The Administrator
[Don't Feed The Animals]
Halx is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46