Through this interface can query Yuantong Express, Shentong Express, EMS Express, Yun Tatsu Express, such as courier tracking information, no additional development, very convenient
First, register an account with www.aikuaidi.cn and use key!
Copy the Code code as follows:
/**
* Query Logistics Information
*/
Define (' In_ecs ', true);
Require (DirName (__file__). '/includes/init.php ');
if ($id = Intval ($_request[' id ')) {
$sql _select = ' Select Consignee,mobile,tel,tracking_sn,shipping_code,shipping_name from '.
$GLOBALS [' ECS ']->table (' Order_info '). " WHERE order_id= $id ";
$order _info = $GLOBALS [' db ']->getrow ($sql _select);
Express Company Code Map
$shipping _code = Array (
' EMS ' = ' EMS ',
' Ems2 ' = ' EMS ',
' sto_express ' = ' zjs ',
' Sto_nopay ' = ' zjs ',
' Zto ' = ' zhongtong ',
' Sto ' = ' shentong ',
' Yto ' = ' yuantong ',
' SF ' = ' Shunfeng ',
' Emssn ' = ' EMS ',
' SF2 ' = ' Shunfeng ',
' Yunda ' = ' Yunda ',
);
$logistics _code = $shipping _code[$order _info[' Shipping_code ']? $shipping _code[$order _info[' Shipping_code ']: $order _info[' Shipping_code '];
$aikuaidi _key = ' xxxxxxx ';
$logistics _url = "http://www.aikuaidi.cn/rest/?key= $aikuaidi _key&order={$order _info[' tracking_sn ']}&id=$ Logistics_code&ord=asc&show=html ";
$logistics _info = file_get_contents ($logistics _url);
Var_dump ($logistics _info);
$logistics _info = iconv (' gb2312 ', ' UTF-8 ', $logistics _info);
Echo <<<>
Consignee:{$order _info[' consignee '}
Tel:{$order _info[' mobile '}//{$order _info[' tel ']}
Delivery:{$order _info[' shipping_name '}
Waybill Number:{$order _info[' tracking_sn '}
EOF;
echo $logistics _info;
echo "
Point me to point me ";
Exit
}
http://www.bkjia.com/PHPjc/765160.html www.bkjia.com true http://www.bkjia.com/PHPjc/765160.html techarticle through this interface can query Yuantong Express, Shentong Express, EMS Express, Yun-Express, such as express ticket tracking information, no additional development, very convenient first to www.aikuaidi.cn registration ...