XML RPC Problem in WordPress

Discussion in 'WordPress' started by roopajyothi, May 9, 2010.

  1. #1
    Hello in the below PHP Code

    Everything seems fine but it did not posts to the site when i use it

    Can any one spot out what type of error it is

    Also here the XML RPC is enabled and the when i access it directly it works(i mean the error message "XML-RPC server accepts POST requests only")


    
    
    <?php
    
    
    function wpPostXMLRPC($title,$body,$rpcurl,$username,$password,$categories=array(1))
    {
    	$username = "testuser";
    	$password = "itestpaass";
    	$rpurl = "http://domain.com/xmlrpc.php";
    	$categories = "info";
    	$XML = "<title>$title</title>"."<category>$categories</category>".$body;
    	$params = array('','',$username,$password,$XML,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);
    
    
    
    };
    
    ?>
    
    PHP:
     
    roopajyothi, May 9, 2010 IP
  2. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Any Update please???
     
    roopajyothi, May 9, 2010 IP