Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Po include przerywa wykonywanie kodu, Dlaczego?
-lukasamd-
post
Post #1





Goście







Witam,
mam do strony załączony skrypt:

  1. <?php
  2. $result = 'SELECT * FROM '.$db_prefix.'mtp WHERE site_id=';
  3.  
  4. if(strpos($_SERVER['REQUEST_URI'],'news.php')) $result .= 1;
  5. elseif(strpos($_SERVER['REQUEST_URI'],'news_cats.php')) $result .= 2;
  6. elseif(strpos($_SERVER['REQUEST_URI'],'articles.php')) $result .= 3;
  7. elseif(strpos($_SERVER['REQUEST_URI'],'readarticle.php')) $result .= 4;
  8. elseif(strpos($_SERVER['REQUEST_URI'],'viewpage.php')) $result .= 5;
  9. elseif(strpos($_SERVER['REQUEST_URI'],'/forum/')) $result .= 6;
  10. elseif(strpos($_SERVER['REQUEST_URI'],'photogallery.php')) $result .= 7;
  11. elseif(strpos($_SERVER['REQUEST_URI'],'downloads.php')) $result .= 8;
  12. elseif(strpos($_SERVER['REQUEST_URI'],'weblinks.php')) $result .= 9;
  13. elseif(strpos($_SERVER['REQUEST_URI'],'profile.php')) $result .= 10;
  14. elseif(strpos($_SERVER['REQUEST_URI'],'search.php')) $result .= 11;
  15. elseif(strpos($_SERVER['REQUEST_URI'],'contact.php')) $result .= 12;
  16. else $error = 1;
  17.  
  18. if($error!=1) {
  19. include INFUSIONS.'mt_panel/locale/Polish.php';
  20. $result = dbquery($result);
  21. $row = dbarray($result);
  22. if($row['last_news'] == 1) include INFUSIONS.'mt_panel/modules/last_news.php';
  23. if($row['popular_news'] == 1) include INFUSIONS.'mt_panel/modules/popular_news.php';
  24. if($row['last_articles'] == 1) include INFUSIONS.'mt_panel/modules/last_articles.php';
  25. if($row['popular_articles'] == 1) include INFUSIONS.'mt_panel/modules/popular_articles.php';
  26. if($row['last_files'] == 1) include INFUSIONS.'mt_panel/modules/last_files.php';
  27. if($row['popular_files'] == 1) include INFUSIONS.'mt_panel/modules/popular_files.php';
  28. if($row['last_fotos'] == 1) include INFUSIONS.'mt_panel/modules/last_photos.php';
  29. if($row['popular_fotos'] == 1) include INFUSIONS.'mt_panel/modules/popular_photos.php';
  30. if($row['last_users'] == 1) include INFUSIONS.'mt_panel/modules/last_users.php';
  31. if($row['last_weblinks'] == 1) include INFUSIONS.'mt_panel/modules/last_weblinks.php';
  32. if($row['popular_weblinks'] == 1) include INFUSIONS.'mt_panel/modules/popular_weblinks.php';
  33. if($row['last_posts'] == 1) include INFUSIONS.'mt_panel/modules/last_posts.php';
  34. if($row['popular_topics'] == 1) include INFUSIONS.'mt_panel/modules/popular_threads.php';
  35. }
  36. ?>


Kiedy sprawdzałem czy działa, okazało się że tak, ale z małym problemem.

Jeżeli np. zostanie spełniony warunek przy pierwszym include, reszta nie jest sprawdzana. Nie wiem czemu się tak dzieje a muszę załączać pliki osobno.
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: 24.08.2025 - 16:01