PHP Express number query interface using sample _php tutorial

Source: Internet
Author: User
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 ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.