<?php
$url = '';
$username = '';
$token = '';
$listid = 'all';
$xml_data = '
<xmlrequest>
<username>' . $username . '</username>
<usertoken>' . $token . '</usertoken>
<requesttype>stats</requesttype>
<requestmethod>GetNewsletterStats</requestmethod>
<responsetype>xml</responsetype>
<details>
<listids>'.$listid.'</listids>
<sortinfo>
<SortBy>Date</SortBy>
<Direction>Down</Direction>
</sortinfo>
<searchinfo>
<DateSentSearch>
<filter>1</filter>
<type>after</type>
<StartDate>'.strtotime('-3 year').'</StartDate>
</DateSentSearch>
</searchinfo>
<start>0</start>
<perpage>all</perpage>
</details>
</xmlrequest>
';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $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);
if (!$pageData) {
echo "Error!: " . curl_error($ch);
echo "\n";
exit;
}
curl_close($ch);
echo $pageData . "\n";
?>
Opmerkingen
0 opmerkingen
U moet u aanmelden om een opmerking te plaatsen.