Include via http
Posted: Fri Sep 16, 2005 4:01 am
Hi,
I'm trying to include a file via http. The remote file is querying a db on the remote server and returning the results.I am then trying to get the result assigned to a vairiable and use it within my local script.
I can echo out the results in the remote file [ the echo is in the remote file] and this works fine, however i want to return a variable that holds the output. When i do this I only get '1' returned even when i test a very simple file??
here is some code
remotefile.php
<?php
$myVar = 'test return value';
return $myVar;
?>
local script:
<?php
$myResult = include' http://www.otherdomain.com/remotefile.php';
echo $myResult;
?>
the echo in the last script always returns 1??
any ideas?
thanks
I'm trying to include a file via http. The remote file is querying a db on the remote server and returning the results.I am then trying to get the result assigned to a vairiable and use it within my local script.
I can echo out the results in the remote file [ the echo is in the remote file] and this works fine, however i want to return a variable that holds the output. When i do this I only get '1' returned even when i test a very simple file??
here is some code
remotefile.php
<?php
$myVar = 'test return value';
return $myVar;
?>
local script:
<?php
$myResult = include' http://www.otherdomain.com/remotefile.php';
echo $myResult;
?>
the echo in the last script always returns 1??
any ideas?
thanks