Problem with conditions

Hi,
I have some problems with if-else etc…
I need move in directories and, i put an icon folder if its a directory, but i want use icons for file extensions too, like executables, images, text etc…
When is a directory shows an image correctly, but when its a file only shows “uknown” image…
Anyone can help me?
Thanks in advance

while(($file=readdir($gd))!==false)
{

            //check if its file 
            if(is_file($path.$file)) 
            { 
                $ext=pathinfo($file);
                if($ext['extension']=NULL) echo "I will put uknown image";
                if($ext['extension']=="exe") echo "I will put .exe image";
                if($ext['extension']=="jpg") echo "I will put .jpg image";
                if($ext['extension']=="txt") echo "I will put .txt image";

else echo “I will put uknown image”;

            } 

            //check if its directory
	if(is_dir($path.$file)) 
            { 

                 if(is_dir($path.$file) && ($file!='.') &&($file!='..')){
	     echo "<a href=http://localhost/index3.php?url=$path$file\><img border=0 src=folder.jpg width=25 height=25><tb>";
	 }

Solved using
If
elseif
elseif
elseif
else

Thank!!

Sponsor our Newsletter | Privacy Policy | Terms of Service