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.

Lascia un commento

Il tuo indirizzo email non sarĂ  pubblicato. I campi obbligatori sono contrassegnati *