Hi,
I dont know of a way to actually return the object data to computer1, but you could echo the data in C2 in a structured format like XML, then use the normal IO functions in C1 to read this, similar to how a web service works. Something like this:
/* computer 1 */
$fp = fopen("http://192.168.1.2/query.php?action=q", "r");
$fromC2 = fread($fp, 1024); // remember filesize() doesnt work with urls
fclose($fp);
// parse XML in $fromC2 here
echo $fromC2;
/* computer 2 */
function getQ()
{
$query = "....";
// create XML from result set here
echo $xmldata; // this will print data for C1 to read
}
switch($_REQUEST['action'])
{
case 'q':
getQ(); break;
.....
}
Instead of text/XML you could use some binary format if you wished (just remember to put "rb" in fopen on windows).
Hope this helps
Philip Cole
|