Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Include na zdalnym pliku
amii
post 1.04.2011, 14:21:02
Post #1





Grupa: Zarejestrowani
Postów: 728
Pomógł: 76
Dołączył: 12.06.2009

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


Ogólnie include działa na takiej zasadzie, że uzyskujemy dostęp do zmiennych i funkcji z zainkludowanego pliku tak się dzieje dla plików lokalnych. Co jednak ze zdalnymi plikami ?

Manual trochę niejasno to formułuje zatem proszę o wyjaśnienie:
1. Czy możliwy jest dostęp do zmiennych i funkcji z zainkludowanego pliku w pliku, który includuje przy założeniu, że to plik zdalny ?


--------------------
gry flash online
Dobry hosting i tanie odnowienia domen firma: masternet.
Zarabianie bez wysiłku na domenach bez ruchu: prolink.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 2)
ylk
post 1.04.2011, 16:30:19
Post #2





Grupa: Zarejestrowani
Postów: 194
Pomógł: 26
Dołączył: 9.01.2011
Skąd: /dev/null

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


IMHO manual to formułuje bardzo jasno:
Cytat
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper - see Supported Protocols and Wrappers for a list of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using a URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.

Czyli includowany plik ze zdalnego serwera jest odpalany na zdalnym serwerze i to co zwróci jest includowane do lokalnego skryptu. Nie ma więc dostępu do funkcji i zmiennych.
Go to the top of the page
+Quote Post
NEO.pl
post 1.04.2011, 22:31:58
Post #3





Grupa: Zarejestrowani
Postów: 71
Pomógł: 5
Dołączył: 26.01.2011

Ostrzeżenie: (40%)
XX---


Cytat(ylk @ 1.04.2011, 17:30:19 ) *
IMHO manual to formułuje bardzo jasno:

Czyli includowany plik ze zdalnego serwera jest odpalany na zdalnym serwerze i to co zwróci jest includowane do lokalnego skryptu. Nie ma więc dostępu do funkcji i zmiennych.


Mylisz pojecia. Inkludowany zdalny plik *moze* byc odpalony na zdalnym serwerze i wynik jego dzialania *moze* nie byc kodem PHP. I tylko wtedy po zaincludowaniu lokalnie nie zostanie wykonany (i tylko dlatego ze nie bedzie co wykonywac). Includowanie zdalnych plikow to proszenie sie o problemy.

Ten post edytował NEO.pl 2.04.2011, 09:42:16
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: 19.07.2025 - 20:00