somthing like...
Code: Select all
include("http://11.22.33.44/remotefile.php") // reads file, returns $fileContentsModerator: General Moderators
Code: Select all
include("http://11.22.33.44/remotefile.php") // reads file, returns $fileContentshttp://se.php.net/manual/en/function.include.php wrote: If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using an URL (via HTTP or other supported wrapper - see Appendix I 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 an 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.
Code: Select all
<?php // whatSoEver.php
$dirlisting = array();
$dh = opendir('.');
while($de = readdir($dh))
$dirlisting[] = $de;
return $dirlisting;
?>Code: Select all
<?php
$dirlisting = include('./whatSoEver.php');
print_r($dirlisting);
?>Code: Select all
<?php // whatSoEver.php
$dirlisting = array();
$dh = opendir('.');
while($de = readdir($dh))
$dirlisting[] = base64_encode($de);
echo '<'."?php return '" .serialize($dirlisting) ."'; ?".'>';
?>Code: Select all
<?php
$returnValue = include('http://your.serv.er/whatSoEver.php');
$dirlisting = unserialize($returnValue);
$dirlisting = array_map('base64_decode', $dirlisting);
print_r($dirlisting);
?>