is_lying(is_dir()) == TRUE
Posted: Mon Jan 24, 2005 8:22 pm
So I'm making a file browser for my website and I've run into a problem. I got it working well, and I'm happy with it, but when I make a folder in the finder (windows: explorer) or even have php (0777) make a folder, when I check it with is_dir(), it returns false...why?
Code: Select all
<?php
foreach($dir as $diritem)
{
if(!eregi("^\.", $diritem))
{
echo("<tr>\r");
if(is_dir($basedir.$diritem)) //where it lies I think
{
echo("stuff for a table");
echo("stuff for a table");
}
else
{
$icon = fext($diritem);
echo("stuff for a table");
echo("stuff for a table");
## Not Really Important ##
/*$size = filesize("{$basedir}{$dirsource}{$diritem}");
if($size > 1024*1024)
{
$size = round($size/(1024*1024), 2);
$size = "{$size} MB";
}
elseif($size > 1024)
{
$size = round($size/(1024), 2);
$size = "{$size} KB";
}
else
{
$size = "{$size} bytes";
}
echo("\t<td id="size">{$size}</td>\r");*/
}
echo("</tr>\r");
}
}
?>