to sto ti zelis, pretpostavljam, je cross site include… i to je pomocu php-a nemoguce napraviti
dakle, nemozes napraviti ako si na npr. server1.com, da imas liniju
include("http://server2.com/neka_skripta.php");
mozes, jedino ako su na istom serveru, pa koristis absolute path do skripte
sam ispis, dakle html koji generira php skripta, mozes ubaciti, odnosno ‘pokupiti’, bilo koristeci curl, bilo fopen, ili bilo koju funkciju koju mozes koristiti na odredjenom serveru
dakle, moze koristiti curl/fopen da bi dobio sljedece
npr. imas file
1.php
<?php
function Test(){
echo "test 2";
}
echo "test";
?>
ako s curlom pokupis content 1.php, dobit ces html ispis "test"
ako zelis includat 1.php, pa poslije koristiti funkciju test, unutar tog file-a, to ne mozes, ako skripte nisu na istom serveru…
dakle, mozes pokupiti samo ispis odredjene skripte, ako ti je to ok, i to sto trazis, koristi curl/fopen…
ako zelis includati odredjenu skriptu zbog funkcija unutra, to ne mozes, ukoliko fileovi nisu na istom serveru
s tim da obratis pozornost na sljedece, mozda ti to moze pomoci
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.