Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Wczytywanie plików PHP z innego serwisu
Forum PHP.pl > Forum > Przedszkole
jestemPolakiem
Wczytywanie plików PHP z innego serwisu

Jak wolno wczytać plik np. include.php z innego serwera, żeby nie tylko uzyskać stronę HTML, a także zmienne. Np.
http://www.xxx.pl/offers/config.php
Kod
<?php
$data = 100;
print "done";
?>

http://www.zzz.pl/
Kod
<?php
include("http://www.xxx.pl/offers/config.php");
print $data;
?>


Proszę o pomoc blinksmiley.gif
AlexDeLarge
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 List of Supported Protocols/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.


To z include. Słowem - nie jest to w normalny sposób wykonalne. Skorzystać możesz, jeśli masz taką możliwość, z sieciowego systemu plików, np. NFS.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.