Thanks.
Code: Select all
<?php
$typeCom = $_GET["com"];//Shipping Carriers
$typeNu = $_GET["nu"]; //Tracking Code
//echo $typeCom.'<br/>' ;
//echo $typeNu ;
$AppKey='XXXXXX';//Please replace XXXXXX with the key you got at http://kuaidi100.com/app/reg.html
$url ='http://api.kuaidi100.com/api?id='.$AppKey.'&com='.$typeCom.'&nu='.$typeNu.'&show=2&muti=1&order=asc';
//Dont' delete information of $powered.
$powered = 'Tracking Data is from:<a href="http://kuaidi100.com" target="_blank">KuaiDi100.Com</a> ';
//curl mode is preferred to send data
if (function_exists('curl_init') == 1){
$curl = curl_init();
curl_setopt ($curl, CURLOPT_URL, $url);
curl_setopt ($curl, CURLOPT_HEADER,0);
curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($curl, CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
curl_setopt ($curl, CURLOPT_TIMEOUT,5);
$get_content = curl_exec($curl);
curl_close ($curl);
}else{
include("snoopy.php");
$snoopy = new snoopy();
$snoopy->referer = 'http://www.google.com/';
$snoopy->fetch($url);
$get_content = $snoopy->results;
}
print_r($get_content . '<br/>' . $powered);
exit();
?>