View Single Post
  #1 (permalink)  
Old 04-20-2003, 02:19 AM
smallfry smallfry is offline
Junior Member
 
Join Date: Mar 2003
Posts: 18
need help with a random image in a block
Hi,
I have a block that displays a random image from a folder and i resently changed my webhosting and the new webhost creates some folder called _vti_cnf inside my image folder and my code doesnt check for images it just displays a random file , folder or image in the folder its checks... so I get an error in my block if it picks the _vti_cnf folder.. I need to set my code up to check if its an image before it picks it .. ive deleted this vti_cnf folder 10 times and it just keeps on recreating itself ...I just don't know how to set up the code to check for an image LOL
thanks for any help you can give me
Code:
if (eregi("block-RandomPic.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}
$kataloog = 'MAPS-PICS/BF/ACTION';
$i = 0;
$kat = opendir ($kataloog);
	while ($f = readdir($kat))
	{	if ($f != '.' && $f != '..') 
		{$nimed[$i++] = $f;}
	}
closedir ($kat);
srand((double)microtime()*1000000);
$nimi = $kataloog.'/'.$nimed[rand(0,sizeof($nimed)-1)];
$suurus = GetImageSize ($nimi);


$content = "<table align=center width=\"142\" height=\"150\" Font=\"Verdana\" fontsize=\"0\">";
Reply With Quote