php include: no absolute path

To get include command working you should avoid an absolute path: i.g. not

http://somepath/somefile

But, i.g.:

../somepath/somefile

2) In localhost it would be possible this workaround:

$yourvariablepath = realpath($_SERVER["DOCUMENT_ROOT"] . "/a/path");

But this doesn’t work in remote.

3) Another workaround to include a content from a file in another absolute path could be the object tag:

<object data=”your-file-even-on-another-server” />

But an object in another page is an island, a stranger “guest”, without any sharing with the “host” page.

4) Another way (for short text) is to use javascript.

linguaggio PHP includere un file remoto

Il comando “include url/nomedelfileremoto” non è sempre accessibile, ed è comunque dispendioso di risorse.
Ho trovato questo comando

<?php
echo file_get_contents(‘http://exempe.com/filename.php’);
?>

Molto utile, ad esempio per condividere dei links tra diversi siti gestitidallo stesso webmaster.
L’ho visto su questo sito.
Occorre che il server supporti la funzione allow_url_fopen (allow_url_fopen=on).