Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Funkcja, Fatal error: Function name must be a string
Bonzaii
post 3.09.2006, 03:06:03
Post #1





Grupa: Zarejestrowani
Postów: 21
Pomógł: 0
Dołączył: 31.08.2006

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


  1. Fatal error: Function name must be a string in E:\usr\main\sql\gallery.php on line 15


Taki mam błąd przy wywoływaniu funkcji i_makesmall($fname);
Oto urywek kodu z użytą funkcją:
  1. <?php
  2. require("convert.php");
  3. $img = dir("img/big");
  4.  
  5. $img_showed = 0;
  6. $img_cur = 0;
  7. if ($_GET['str']) $img_start = $_GET['str'] * 6;
  8. else $img_start = 1;
  9. while ($img_showed < 6 && $file = $img -> read()) {
  10. $file_pi = pathinfo($file);
  11. $fname = $file_pi['basename'];
  12. if ($fname == ".." || $fname == "." || $fname == "") continue;
  13. $img_cur++;
  14. if ($img_cur >= $img_start) {
  15. if (!$exists("img/small/$fname")) { i_makesmall($fname); }
  16. ?>

Funkcja jest stworzona w pliku "convert.php".

Co jest nie tak?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
Cysiaczek
post 3.09.2006, 03:14:09
Post #2





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Zajrzyj do tego pliku (convert.php) i zobacz jak zdefiniowałeś funkcję. Na pewno zrobiłeś to błędnie.
Pozdrawiam.

Ten post edytował Cysiaczek 3.09.2006, 03:14:27


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
Bonzaii
post 3.09.2006, 10:38:54
Post #3





Grupa: Zarejestrowani
Postów: 21
Pomógł: 0
Dołączył: 31.08.2006

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


Rano wstałem i nagle mnie olśniło że popełniłem bardzo głupi błąd w lini 15 pliku gallery.php:
  1. <?php
  2. if (!$exists("img/small/$fname")) { i_makesmall($fname); }
  3. ?>

Nawyki z innego języka programowania.
!$exists("img/small/$fname") - co to ma być? (To jest poprawna funkcja w programie mIRC)
Powinno być:
  1. <?php
  2. if (file_exists("img/small/$fname") == false) { i_makesmall($fname); }
  3. ?>


Tak mam i jest dobrze smile.gif
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: 25.07.2025 - 10:15