国际包裹跟踪PHP代码Word格式文档下载.docx
- 文档编号:21629186
- 上传时间:2023-01-31
- 格式:DOCX
- 页数:18
- 大小:17.66KB
国际包裹跟踪PHP代码Word格式文档下载.docx
《国际包裹跟踪PHP代码Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《国际包裹跟踪PHP代码Word格式文档下载.docx(18页珍藏版)》请在冰豆网上搜索。
p>
Getshippingrate.<
/p>
formaction="
XMLGetRateRespones.php"
method="
post"
tablecellpadding="
0"
<
tr>
td>
Country<
/td>
selectname="
countryName"
$doc=newDOMDocument();
$doc->
load(REQUIRECOUNTRYURL);
$dataset=$doc->
getElementsByTagName("
country"
);
foreach($datasetas$row){
$countryNames=$row->
englishname"
$countryName=$countryNames->
item(0)->
nodeValue;
?
//HTTPREQUIREURL
define('
REQUIRESHIPTYPE'
ShipClass<
shipmode"
load(REQUIRESHIPTYPE);
$dataArr=$doc->
shiptype"
foreach($dataArras$row){
$en_names=$row->
en_name"
$en_name=$en_names->
$method_codes=$row->
method_code"
$method_code=$method_codes->
optionvalue='
phpecho$method_code?
'
phpecho$en_name?
/option>
php}?
/select>
/tr>
/table>
/form>
REQUIRESHIPCLASS'
ShipType<
classType"
load(REQUIRESHIPCLASS);
shipclass"
$class_codes=$row->
class_code"
$class_code=$class_codes->
optionvalue='
phpecho$class_code?
/select>
/td>
/table>
此查询需要提交国际包裹的目的国家与重量。
所以在提交查询时,我们先生成一个表单来取得国家信息与货物重量,再提交查询。
提交查询表单代码:
getRateRespones.php"
phpecho$countryName?
Weight:
inputtype="
text"
name="
weight"
/>
tdcolspan="
2"
submit"
value="
GetRates"
getRateRespones.php代码:
//URLtocall
REQUIRERATE'
$countryName=@$_POST['
countryName'
];
$weight=@$_POST['
weight'
//ConstructtheGetShippingRatecall
$profile='
country='
.$countryName.'
&
weight='
.$weight;
require_once'
XMLGetRate.php'
;
$doc=newDOMDocument();
load(REQUIRERATE.$profile);
//LoadthecallandcapturethedocumentreturnedbyAPI
rate"
//Checktoseeiftheresponsewasloaded,elseprintanerror
if(@$dataset->
nodeValue){
hrcolor="
#6794B8"
size="
>
tablecellspacing="
1"
cellpadding="
width="
85%"
tralign="
center"
bgcolor="
#C3D5FD"
thwidth="
30%"
MailService<
/th>
25%"
TotalFee(&
#165;
CNY)<
Deliverytime(Workday)<
10%"
Tracking<
Byvolume<
//ForeachShippinhRateItemnode,anddisplayallofthem
$totalfees=$row->
totalfee"
$totalfee=$totalfees->
$deliverytimes=$row->
deliverytime"
$deliverytime=$deliverytimes->
$iftrackings=$row->
iftracking"
$iftracking=$iftrackings->
$classtypes=$row->
classtype"
$classtype=$classtypes->
$byvolumes=$row->
byvolume"
$byvolume=$byvolumes->
$shiptypes=$row->
shiptypename"
$shiptypename=$shiptypes->
#ffffff"
tdwidth="
phpecho$shiptypename?
phpecho$totalfee?
phpecho$deliverytime?
phpecho$iftracking?
phpecho$byvolume?
}
}else{
//displayerrormessage
$errors=$doc->
errors"
$error=$errors->
echo$error;
}
此查询需要提交国际包裹的目的国家、重量与类型。
在提交查询前,我们应生成一个表单来取得国家信息、货物重量与类型,再提交查询。
Getshippingratebytype.<
getRateByTypeRespones.php"
$doc->
$dataset=$doc->
//获取国家
foreach($datasetas$row){
$countryNames=$row->
$countryName=$countryNames->
unset($doc);
tr>
td>
Type<
selectname="
type"
$dataArr=$doc->
//获取运费类型
foreach($dataArras$row){
$en_names=$row->
$en_name=$en_names->
$class_codes=$row->
$class_code=$class_codes->
/tr>
tdcolspan="
/form>
getRateByTypeRespones.php代码:
//ConstructtheGetShippingRateBytype
$profile.='
type='
.$_POST['
type'
require_once'
XMLGetRateByType.php'
此查询需要提交国际包裹的目的国家、重量与邮寄方式。
在提交查询前,我们应生成一个表单来取得国家信息、货物重量与邮寄方式,再提交查询。
Getshippingratebymode.<
Country:
load(REQUIRECOUNTRYURL
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 国际 包裹 跟踪 PHP 代码
![提示](https://static.bdocx.com/images/bang_tan.gif)