Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Ignoruje include !, coś ze skryptem nie tak...
-Słoń Edward-
post
Post #1





Goście







Mam wielki problem! Napisałem, z małą pomocą, skrypt, jednak on całkowicie ignoruje include! W innych plikach jest zapisane to w ten sam sposób i wszystko działa...

  1. <?php
  2. $lista = array();
  3. if ($handle = opendir('wydania/')) {{
  4.  while (false !== ($file = readdir($handle))) {
  5.  if ($file != &#092;".\" && $file != \"..\" && $file[0] != \".\" ) {
  6. if (eregi('numer', $file))
  7. $lista[count($lista)]=$file;}
  8.  }
  9.  }
  10.  closedir($handle);
  11. }
  12. echo &#092;"Oto wydane wydania. Bierzcie i jedzcie: <br>\";
  13. sort($lista);
  14. reset($lista);
  15. $lista = array_reverse($lista);
  16. while (list($key, $val) = each($lista)) {
  17. include(&#092;"wydania/$val\");
  18. }
  19.  
  20. ?>
Go to the top of the page
+Quote Post
crash
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 196
Pomógł: 2
Dołączył: 17.01.2004
Skąd: Sosnowiec

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


  1. <?php
  2. $lista = array();
  3. if($handle = opendir('wydania/'))
  4. {
  5.  while(false !== ($file = readdir($handle)))
  6.  {
  7. if($file != '.' && $file != '..' && $file{0} != '.' )
  8. {
  9.  if(eregi('numer', $file))
  10. $lista[] = $file;
  11. }
  12.  }
  13.  closedir($handle);
  14. }
  15. echo 'Oto wydane wydania. Bierzcie i jedzcie: <br>';
  16. sort($lista);
  17. reset($lista);
  18. $lista = array_reverse($lista);
  19.  
  20. foreach($lista as $key => $val))
  21. {
  22.  include('wydania/'.$val);
  23. }
  24. ?>
Go to the top of the page
+Quote Post
-Słoń Edward-
post
Post #3





Goście







Widzę, że kilka poprawek tu wprowadziłeś. (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Ale czy sprawdzałeś to u siebie? Bo u mnie w ogóle nie działa. Plik nie wyświetla nic. (IMG:http://forum.php.pl/style_emoticons/default/sad.gif) Nawet tego, co jest wpisane do "echo"...
Go to the top of the page
+Quote Post
NuLL
post
Post #4





Grupa: Zarejestrowani
Postów: 2 262
Pomógł: 21
Dołączył: 3.05.2004
Skąd: Sopot, Krakow, W-wa

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


Zupełnoie nic nie pokazuje :?:
Go to the top of the page
+Quote Post
-Słoń Edward-
post
Post #5





Goście







Zupełnie. Zresztą zrobiłem próbę. Przed wprowadzeniem tablic pliki się includują, a po wprowadzeniu tablic już nie. A nic nie wyświetla się chyba przez to "foreach"... gdy zmieniłem z powrotem na while, to działało...
Go to the top of the page
+Quote Post

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: 22.08.2025 - 15:01