Autor Zpráva
mechanix
Profil *
Potreboval by som aby mi tento skript zobrazoval LEN subory JPG!

<html>
<head>
<title>Index Page</title>
</head>

<body>
<?php
if ($handle=opendir('.')) {
while ($file = readdir($handle))
{
$polozky[count($polozky)] = $file;
}
closedir($handle);
sort($polozky);
}

reset($polozky);
while (list($key, $val) = each($polozky))
{
if ($val != "." && $val != "..")
{
if (is_dir($val))
{
echo "(DIR) ";
echo "<a href=\"$val\">$val</a><br>\n";
}
}
}
echo "<br>\n";
reset($polozky);
while (list($key, $val) = each($polozky))
{
if ($val != "." && $val != "..")
{
if (!is_dir($val))
{
echo "<a href=\"$val\">$val</a><br>\n";
}
}
}
?>
</body>
</html>
nightfish
Profil
if ($handle=opendir('.')) {
while ($file = readdir($handle))
{
$polozky[count($polozky)] = $file;
}
closedir($handle);
sort($polozky);
}

změnit na

if ($handle=opendir('.')) {
while ($file = readdir($handle))
{
if (($file == ".") || ($file == "..")) continue;
if ((substr($file,-4) != ".jpg") && (substr($file,-5) != ".jpeg")) continue;
$polozky[] = $file;
}
closedir($handle);
sort($polozky);
}
mechanix
Profil *
nightfish

Ďakujem za radu! Funguje to! :-)
Toto téma je uzamčeno. Odpověď nelze zaslat.

0