Post a record to the php to query the source code of the express waybill number, which can be used to query the record of the express waybill number of various types of express parcels. It is not a problem for zhongtong, yuantong Express, and SF Express. You only need
Love Express (www.aikuaidi.cn) to apply for a courier key, the following share the source code, I tested, no problem. You can find the express delivery tracking information.
<? Php/*** 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 ); // courier company code ing $ shipping_code = array ('EMS' => 'EMS', 'ems2 '=>' EMS ', 'Sto _ express '=> 'zjs', 'sto _ nopa' => 'zjs', 'zto' => 'zhongtong', 'sto' => 'shentong ', 'yto '=> 'yuyun G', '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 = 'xxx '; love Express Application $ logistics_info = file_get_contents ($ logistics_url); // var_dump ($ logistics_info); // $ logistics_info = iconv ('gb2312', 'utf-8 ', $ logistics_info); echo <EOF <span> receiver: <strong >{$ order_info ['consignee']} </strong> </span> <span> contact number: <strong> {$ order_info ['mobile']} // {$ order_info ['tel']} </strong> </span> <span> delivery: <strong >{$ order_info ['shipping _ name'] }</strong> </span> <span> waybill number: <strong >{$ order_info ['tracking _ sn '] }</strong> </span> <br> EOF; echo $ logistics_info; echo "<br> <a href = '$ logistics_url 'target =' _ self '> click me </a>"; // exit ;}