Unifix knowledge database - The original one

Dashboard - News - Search - List - About - Admin


Slideshow , autorotation of all files in directory. Written in PHP

Author:mike - Thu May 19 04:56:25 2005

<?

# read .jpg files into array
$dir=opendir(".");
while ($dat = readdir($dir)) { if (substr($dat,strlen($dat)-4)==".jpg") { $pics[]=$dat; }}
closedir($dir);

# Increment the image value
if ($_REQUEST['image'])
{ $img=$_REQUEST['image']; $img++;
} else {$img=1;}
if ( $img >= count($pics))  {$img=0;}

# Automatic reload
print '<meta http-equiv="refresh" content="5, url=?image='.$img.'">';

# Show picture #img in pics array
print "<img src=".$pics[$img+1].">";
?>
~     
Copyright(c) Unifix.org 2002-2011


Dashboard - News - Search - List - About - Admin
 
Powered by Mikjaer Consulting Solutions - Hosted by Specialhosting.dk