Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem z bardzo uproszczoną galerią
covall
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 9.03.2004
Skąd: Stalowa Wola

Ostrzeżenie: (0%)
-----


Witam. Napisałem bardzo prosty skrypt galerii, jeżeli można to nazwać galerią (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) ... jest to skrypt, który pobiera wszystkie obrazki z danego katalogu. Możecie zobaczyć go pod tym adresem. Problem polega na tym, iż przed każdym obrazkiem wywala taki błąd (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) :
Cytat
Warning: filetype(): Lstat failed for (null) (errno=2 - No such file or directory) in /var/www/html/gallery.php on line 6


Hmm... nie wiem za bardzo co jest źle... poniżej kod:
  1. <?
  2. $dir = &#092;"./screen/sa/skany/\";
  3. if (is_dir($dir)) {
  4. $dh = opendir($dir);
  5. while ($file = readdir($dh)) {
  6. if(filetype($file) != &#092;"dir\")
  7. echo &#092;"<A class=image HREF=$dir$file target=_blank><IMG SRC=$dir$file WIDTH=100 HEIGHT=100 BORDER=0></A>n\";
  8. }
  9. closedir($dh);
  10. }
  11. ?>


Z góry dziękuję za każdą, nawet najmniejszą pomoc.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
mike
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


A może tak :
  1. <?php
  2. // ...
  3. while ( $file = readdir( $dh ) ) 
  4. {
  5. if( ( $file != &#092;".\" ) && ( $file != \"..\" ) && ( filetype( $file ) != \"dir\" ) )
  6. {
  7. // ...
  8. }
  9. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 4.10.2025 - 09:08