<?php
$c = $_GET['c'];
$dir = "produkty/".$c."/";
while (($file = readdir($dh)) !== false) { if (($file != '.')&&($file != '..')) {
if ($filetypes == 'file') {
$files = $dir.$file;
if ($data[1] == "jpg") {
echo "<a href="$files"> <img src="$files" width="200px
" height="200px
"> </a>"; }
if ($data[1] == "gif") {
echo "<a href="$files"> <img src="$files" width="200px
" height="200px
"> </a>"; }
if ($data[1] == "bmp") {
echo "<a href="$files"> <img src="$files" width="200px
" height="200px
"> </a>"; }
if ($data[1] == "JPG") {
echo "<a href="$files"> <img src="$files" width="200px
" height="200px
"> </a>"; }
if ($data[1] == "GIF") {
echo "<a href="$files"> <img src="$files" width="200px
" height="200px
"> </a>"; }
if ($data[1] == "BMP") {
echo "<a href="$files"> <img src="$files" width="200px
" height="200px
"> </a>"; }
if ($data[1] == "png") {
echo "<a href="$files"> <img src="$files" width="200px
" height="200px
"> </a>"; }
if ($data[1] == "PNG") {
echo "<a href="$files"> <img src="$files" width="200px
" height="200px
"> </a>"; }
}
}
}
}
}
?>
<?php
$dir = "produkty/";
while (($file = readdir($dh)) !== false) { if (($file != '.')&&($file != '..')) {
if ($filetype == 'dir') {
<tr>
<td width="30px" height="11px"><img src="image/kw.gif"></td>
<td width="145px" height="25px"><font color="9d8a8a"><a href="?d=produkty&c=$file">$file</a></font></td>
</tr>
<tr>
<td colspan="2"><p style="border-bottom-style: dashed; border-bottom-width: thin; border-bottom-color: acbd55; "></p></td>
</tr>";
}
}
}
}
}
?>
Napisałem taki skrypt, tyle że mam z nim 2 problemy... Skrypt powinien działać następująco: w katalogu "produkty" tworzy się foldery i kopiuje do nich zdjęcia.
pierwszy problem odnosi się do pierwszego fragmentu kodu, mianowicie nie wszystkie zdjęcia są wyświetlane na stronie.
Niejestem w stanie sprawdzić od czego to zależy że jedno zdjęcie w formacie *.jpg jest wyświetlane a inne w tym samym formacie już nie .
Natomiast drugi problem jest z 2 fragmentem kodu, jeśli w katalogu "produkty" utworzy się folder o nazwie np. "ąśżźćłóę" to nie ma polskich znaków tylko krzaki.
Jak to poprawić ?