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);



};

?>

Any Update on this please ???

Please somebody reply on this

Please remove the semi colon from line#23. as function defination dont need any delimiter (;) at the end

@saad.khalid: tried but did not worked :(

None helped till now :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.