淺川です。
> $dh = opendir("/home/test/sample/");
> while ($entry = readdir($dh)) {
> if(is_file($entry)) {
> print "{$entry}<br>\n";
> }
> }
> closedir($dh);
if( is_file("/home/test/sample/" . $entry ) )
カレントディレクトリが /home/test/sample でないなら
上記のようにする必要があります。