My code is :
function test($function,$param, $auth)
{
$request = xmlrpc_encode_request($function,$param);
if($auth!='') $auth = "\nAuthorization: Basic $auth";
$context = stream_context_create(array('http' => array(
'method' => "POST",
'header' => "Content-Type:text/xml" . $auth,
'content' => $request
)));
$file = file_get_contents("http://gwdev.zoomacom.org/xmlrpc.php", false, $context);
$response = xmlrpc_decode($file);
if (xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
}
return($response);
}
//connexion
$function = ‘system.login’;
$param = array(‘username’ => ‘…’, ‘password’ => '…);
$auth = ‘’;
$res= test($function,$param,$auth);
//Session
$auth1 = base64_encode($res[‘sessionid’] . ‘:’ . $res[’$kp3’]);
//requête
$function1 = ‘addressbook.boaddressbook.search’;
$param1 = array(‘start’ => ‘0’,‘limit’=>‘0’
,‘filter’=>‘adr_one_localite=0,adr_two_localite=0’
,‘sort’=>‘asc’
,‘order’=>‘n_given’);
$res1= test($function1,$param1,$auth1);
print_r($res1);
but I would like to have :
//requête
$function1 = ‘addressbook.boaddressbook.search’;
$param1 = array(‘start’ => ‘0’,‘limit’=>‘0’
,‘filter’=>'adr_one_localite like ‘%42000%’
,‘sort’=>‘asc’
,‘order’=>‘n_given’);
$res1= test($function1,$param1,$auth1);
print_r($res1);
except that it does not work? Why?