<?php
$api_url = '';
$api_username = '';
$api_token = '';
$listid = 14;
$xml_data = '
<xmlrequest>
<username>' . $api_username . '</username>
<usertoken>' . $api_token . '</usertoken>
<requesttype>subscribers</requesttype>
<requestmethod>GetSubscribers</requestmethod>
<responsetype>json</responsetype>
<details>
<searchinfo>
<List>
<array>' . $listid . '</array>
</List>
<Confirmed>1</Confirmed>
<Status>a</Status>
</searchinfo>
</details>
</xmlrequest>
';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_POST, true);
if (!ini_get('safe_mode') && ini_get('open_basedir') == '') {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
}
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'xml=' . $xml_data);
$pageData = curl_exec($ch);
echo $pageData; exit;
if (!$pageData) {
echo "Error!: " . curl_error($ch);
echo "\n";
exit;
}
curl_close($ch);
$xmlObj = new SimpleXMLElement($pageData);
var_dump($xmlObj);
exit;
if ($xmlObj->status == 'FAILED') {
$errors[] = 'Er konden geen gegevens uit de database worden opgehaald.';
} elseif ($xmlObj->status == 'SUCCESS') {
foreach ($xmlObj->data->item as $item) {
}
}
Opmerkingen
0 opmerkingen
U moet u aanmelden om een opmerking te plaatsen.