ama yaparken response değişkenine atıyorum sonra yazdırdığımda sadece 1 çıkıyor print_r denedim gene 1 çıkıyor curl_exec($curlhandler) ekrana tam olarak çıkıyor ama response çıkmıyor aramayı curlhandlerde yapamıyorum curl_exec ı kaldırıp echo yazdıgımda ondada cevap değişiyor.
if(isset($_POST['giris'])){
$link=$_POST["form_1"];
$link=rtrim($link,"/");
$USERNAME = $_POST["form_2"];
$PASSWORD = $_POST["form_3"];
function get_response($URL, $context) {
if(!function_exists('curl_init')) {
die ("Curl PHP package not installedn");
}
/*Initializing CURL*/
$curlHandle = curl_init();
/*The URL to be downloaded is set*/
curl_setopt($curlHandle, CURLOPT_URL, $URL);
curl_setopt($curlHandle, CURLOPT_HEADER, false);
curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $context);
/*Now execute the CURL, download the URL specified*/
$response = curl_exec($curlHandle);
return $response;
}
/*Creating the wp.getUsersBlogs request which takes on two parameters
username and password*/
$request = xmlrpc_encode_request("wp.getUsersBlogs",
array($USERNAME, $PASSWORD));
/*Making the request to wordpress XMLRPC of your blog*/
$link=$_POST["form_1"];
$link=rtrim($link,"/");
$xmlresponse = get_response($link."/xmlrpc.php", $request);
$response = xmlrpc_decode($xmlresponse);
if ($response && xmlrpc_is_fault($response)) {
trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {
/*Printing the response on to the console*/
print_r($response);
}
echo "n";
}