Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> require_once zwraca 1, a zawartość pliku przed doctype, require_once zwraca 1, a zawartość pliku przed doctype
zazdrosny17
post
Post #1





Grupa: Zarejestrowani
Postów: 55
Pomógł: 0
Dołączył: 24.07.2010

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


Witam,

Stworzyłem sobie klase. Tutaj wklejam uproszczoną wersję (plik: klasy/Test.php):

  1. class Test
  2. {
  3. public $content = "";
  4.  
  5. public function __set($name, $value)
  6. {
  7. $this->$name = $wartosc;
  8. }
  9.  
  10. public function Show()
  11. {
  12. echo "<div id=\"content\">".$this->content."</div>\n";
  13. }
  14. }


Następnie w katalogu głównym mam plik (index.php) o takiej zawartości:

  1. <?php
  2.  
  3. require_once('klasy/Test.inc');
  4.  
  5. $test= new Test();
  6. $test->content = require_once 'modul/rejestracja.inc';
  7. $test->Show();
  8.  
  9. ?>


Plik modul/rejestracja.inc:

  1. <?php require_once 'modules/register/index.php'; ?>


I tu już ostatni plik (modules/register/index.php):
  1. <?php echo "lol"; ?>


Teraz jesli odpalę index w katalogu głównym, przed doctype widzę string 'lol', a w miejscu gdzie powinien się wyświetlić ten string jest '1'.

Proszę o pomoc.

Ten post edytował zazdrosny17 31.01.2013, 19:54:55
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: 23.08.2025 - 16:57