XML RPC and PHP
-
Hello,
I am using the WP 2.9 and i need to use XML RPC Feature in WP to posts the Blog Post
When i use PHP and XML RPC it does not worksI have enabled the XML RPC feature in WP and here is the PHP Code i used
Can some one say how can i fix this??
<?php $username = "testuser"; $password = "itestpaass"; $rpurl = "https://domain.com/xmlrpc.php"; $categories = "info"; $title = "We want a test post"; $categories = "Test"; $body = "This is the body of the post" function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$categories=array(1)) { $params = array('','',$username,$password,1); $request = xmlrpc_encode_request('blogger.newPost',$params); $ch = curl_init(); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_URL, $rpcurl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 1); curl_exec($ch); curl_close($ch); }; ?>
Thanks in advance!
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘XML RPC and PHP’ is closed to new replies.