login  Naam:   Wachtwoord: 
Registreer je!
 Forum

foreach error

Offline robmoorman - 03/12/2004 18:10
Avatar van robmoormanPHP interesse ik krijg de volgnde errors:
Warning: Invalid argument supplied for foreach() in c:\domains\filiaal1220.nl\wwwroot\g0dlike\dir.php on line 27

Warning: Invalid argument supplied for foreach() in c:\domains\filiaal1220.nl\wwwroot\g0dlike\dir.php on line 30


komt er niet uit, wie weet raad, bvd

  1. <?php
  2.  
  3. //Config
  4. $lang['link'] = "Download this file";
  5. $lang['open'] = "Open this map";
  6.  
  7. if (empty ($_GET['m'])) {
  8. $map = "";
  9. } else {
  10. $map = $_GET['m'];
  11. }
  12.  
  13. $array['maps'] = array();
  14. $array['files'] = array();
  15.  
  16. if ($open = opendir($map)) {
  17. while (($data = readdir($open)) == TRUE) {
  18. if ($data != "." && $data != "..") {
  19. if (!explode(".", $data)) {
  20. $array['maps'] = $data;
  21. } else {
  22. $array['files'] = $data;
  23. }
  24. }
  25. }
  26. closedir($open);
  27. }
  28.  
  29. //The output
  30. foreach ($array['maps'] as $maps) {
  31. echo "<a href='dir.php?m=".$map."/".$maps."' title='".$lang['open']."'><b>".$map."</b></a><br>";
  32. }
  33. foreach ($array['files'] as $files) {
  34. echo "<a href='".$map."/".$file."' title='".$lang['link']."'><b>".$files."</b></a><br>";
  35. }
  36.  
  37. ?>

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.172s