Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Co to jest za problem?
wycicha
post 22.03.2005, 17:00:39
Post #1





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.08.2004

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


Co może mówić ten błąd ?
Fatal error: Cannot redeclare page() (previously declared in E:\Program Files\WebServ\httpd\module\news\index.mod:3) in E:\Program Files\WebServ\httpd\module\news\index.mod on line 4

A tu jest reszta kodu.
  1. <?php
  2. #Loading modules
  3. $module = $_GET[&#092;"mod\"];
  4. $result = mysql_query(&#092;"SELECT id, name_mod, patch_mod, install_mod, active_mod  FROM modules\",$cfg[\"conn\"]);
  5.  
  6. //Class
  7. class modules {
  8.  
  9. var $mod;
  10.  var $res;
  11. var $type_mod;
  12.  
  13.  function include_mod(){
  14.  while ($row = mysql_fetch_array($this -> res, MYSQL_ASSOC)) {
  15. if ($row[&#092;"name_mod\"] == $this -> mod){
  16.  if ($row[&#092;"active_mod\"] == 1){
  17.  //Sprawdza czy był już includowany moduł
  18. include($row[&#092;"patch_mod\"].\"index.mod\");
  19.  }
  20.  }
  21.  }
  22. }
  23.  
  24. function init(){
  25. if ($this -> type_mod == &#092;"page\") {$body = page(); return $body;}
  26.  if ($this -> type_mod == &#092;"menu\") {$menu = menu(); return $menu;}  
  27. }
  28.  
  29. }
  30. //End Class
  31.  
  32.  
  33.  
  34.  
  35.  
  36. // Funkcje ładowania modułu
  37. if ($module != ''){
  38. $class = new modules();
  39. $class -> mod = $module
  40. $class -> res = $result;
  41. $class -> type_mod = &#092;"page\";
  42. $class -> include_mod();
  43. $body = $class -> init();
  44. } else {
  45. include($cfg[&#092;"patch_module\"].$cfg[\"mod_default\"].'/index.mod');
  46. $body  = page();
  47. }
  48. //Function
  49. function menu_mod($menu){
  50. global $result;
  51. $class_m = new modules();
  52. $class_m -> mod = $menu;
  53. $class_m -> res = $result;
  54. $class_m -> type_mod = &#092;"menu\";
  55. $class_m -> include_mod();
  56. $body = $class_m -> init();
  57. return $body;
  58. }
  59.  
  60.  
  61.  
  62.  
  63.  
  64. ?>



PS.
Pomóżcie Sad sadsmiley02.gif


--------------------
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
kszychu
post 22.03.2005, 17:09:06
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 712
Pomógł: 23
Dołączył: 27.10.2003
Skąd: z kontowni

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


Błąd ten mówi, że php nie potrafi ponownie zadeklarować wcześniej już zadeklarowanej funcji. Krótko, php nie obsługuje przeciążenia funkcji.


--------------------
"Coś się kończy, coś się zaczyna." Andrzej Sapkowski
Go to the top of the page
+Quote Post
wycicha
post 22.03.2005, 17:15:50
Post #3





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 1.08.2004

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


czyli bede musiał tylko jeden raz zincludować plik


--------------------
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
Go to the top of the page
+Quote Post
kszychu
post 22.03.2005, 17:57:54
Post #4





Grupa: Przyjaciele php.pl
Postów: 2 712
Pomógł: 23
Dołączył: 27.10.2003
Skąd: z kontowni

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


POlecam uwadze include_once() i require_once().


--------------------
"Coś się kończy, coś się zaczyna." Andrzej Sapkowski
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 13.08.2025 - 23:06