Vous n'êtes pas identifié(e).
13 février 2024 Sortie de Dotclear 2.29
Pages : 1
Hello :)
I'm trying to add post by metaWeblog.newPost, my code:
include('phpxmlrpc.php');
$usr = 'login';
$pwd = 'password;
$xmlrpc = 'http://domain.com/index.php?xmlrpc/default';
$function_name = "metaWeblog.newPost";
$url = $xmlrpc;
$client = new xmlrpc_client($url);
$client->return_type = 'phpvals';
$message = new xmlrpcmsg(
$function_name,
array(
new xmlrpcval(1, "int"),
new xmlrpcval($usr, "string"),
new xmlrpcval($pwd, "string"),
new xmlrpcval(
array(
"title" => new xmlrpcval("Title", "string"),
"description" => new xmlrpcval("Desc", "string"),
),
"struct"
),
new xmlrpcval(true,"boolean")
)
);
$resp = $client->send($message);
if ($resp->faultCode()) echo 'KO. Error: '.$resp->faultString(); else echo "Post id is: " . $resp->value();
But i have error: Invalid method parameters.
What i'm doing wrong? Thanks for help :)
Hors ligne
Thanks :)
Hors ligne
Hors ligne
Hors ligne
Thanks i will check it :)
Hors ligne
It's working, thank you very much :)
Hors ligne
Pages : 1
Vous n'êtes pas identifié(e).