[php] Simple random image display script
This is a script that I use on other boards to display a random avatar / sig image. You can get it working in a few steps: a) change the path to wherever the images are located, b) change the image names, c) plop the url of the script between some [ img ][ /img ] tags (no spaces).
LINKY (gzipped tar format): http://www.seretogis.org/files/linka...m-image.tar.gz
PHP Code:
<?
$path = "/home/wherever/your/files/are/located/";
$images = array ( "a.jpg",
"b.jpg",
"c.jpg"
);
$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;
?>
__________________
seretogis - sieg heil
perfect little dream the kind that hurts the most, forgot how it feels well almost
no one to blame always the same, open my eyes wake up in flames
Last edited by seretogis; 10-13-2003 at 11:43 PM..
|