![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 217 Pomógł: 8 Dołączył: 8.12.2010 Ostrzeżenie: (0%) ![]() ![]() |
Witam, nie wiem czemu ale gdy chcę wyświetlić plik x.php w index.php to wyświetla mi "1" :/ zamiast zawartości pliku.
Plik x.php
Plik index.php
Plik home.php
Jeśli w x.php będę miał tak:
To będzie działać, ale ja tak nie chcę ponieważ w pliku x.php będzie znajdować się kod php i html. Nie da się jakoś zastąpić tego return i żeby zamiast wpisywania kodu w return, w pliku index.php po prostu wyświetlało mi tak jak powinno? Ten post edytował ZeTu 24.09.2012, 15:58:01 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 116 Pomógł: 8 Dołączył: 21.11.2008 Ostrzeżenie: (0%) ![]() ![]() |
nie możesz użyć instrukcji przypisania (znaku =) do include, który dołącza jakiś inny skrypt (no chyba, ze uzywasz tam return ale i tak dziwne rozwiazanie)
Cytat (Handling Returns: include returns FALSE on failure and raises a warning. Successful includes, unless overridden by the included file, return 1. It is possible to execute a return statement inside an included file in order to terminate processing in that file and return to the script which called it. Also, it's possible to return values from included files. You can take the value of the include call as you would for a normal function. This is not, however, possible when including remote files unless the output of the remote file has valid PHP start and end tags (as with any local file). You can declare the needed variables within those tags and they will be introduced at whichever point the file was included.) po prostu: include łączy ze sobą jakieś skrypty file_get_contents pobiera zawartość pliku (to możesz do zmiennej przypisać) Zapoznaj się dokładniej z include i file_get_contents Ten post edytował kyku 24.09.2012, 14:10:32 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 11.10.2025 - 06:47 |