Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Wczytywanie plików PHP z innego serwisu
jestemPolakiem
post
Post #1





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 20.02.2010

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


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 (IMG:style_emoticons/default/blinksmiley.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
AlexDeLarge
post
Post #2





Grupa: Zarejestrowani
Postów: 85
Pomógł: 14
Dołączył: 14.02.2010

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


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.
Go to the top of the page
+Quote Post

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: 24.08.2025 - 18:50