Hi,
I am using getclientsproducts to get the product details of a user. The user has
2 products. So it returns an array with that details of that 2 products. How can i access these details using PHP. I tried to use PHP DOM XML, but it reades only XML data.
$url = "url"; # URL to WHMCS API file
$whmcsadminusername= "username"; # Admin username goes here
$whmcsadminpassword= "password"; # Admin password goes here
$postfields["username"] = $whmcsadminusername;
$postfields["password"] = md5($whmcsadminpassword);
$postfields["action"] = "getclientsproducts";
$postfields["clientid"] = "290";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);
/* $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$data = curl_exec($ch);
curl_close($ch);*/
$data = explode(";",$data);
foreach ($data AS $temp) {
$temp = explode("=",$temp);
$results[$temp[0]] = $temp[1];
}
//print_r($data);
echo '<pre>' . print_r($results, true) . '</pre><br /><br />';
And here is the link to the site.
http://www.superquicksite.com/test_api.php
I would be much appriciate your help.
Thank you.