Location: PHPKode > projects > AModules3 > amodules-3.0.1/samples/11-rpc/caller.php
<?
include '../../trunk/loader.php';

$api = new ApiWeb('caller');

$h=$_SERVER['SCRIPT_URI'];
$h=substr($h,0,-strlen('caller.php')).'remote.php';
# if you use apache @ localhost it might not detect it's own URL properly.
#$h='http://localhost/amodules3/samples/11-rpc/remote.php';

echo "The following calculus will be executed by TestClass (remotely) which will be called by this script: $h<p>";

$remote = $api->add('RPC')
    ->setURL($h)
    ->setSecurityKey('helloworld');

$answer = $remote->summ_numbers(2,3);
echo "Sum of 2 and 3 is: $answer<br>";

// you can customize CURL options
curl_setopt($remote->ch,CURLOPT_VERBOSE,1);

// and try again
$answer = $remote->multiply_numbers(100,200);
echo "Multiplication of 100 and 200 is: $answer<br>";

Return current item: AModules3