1. Import
This commit is contained in:
35
html/tools/tracking/sendReq.php
Normal file
35
html/tools/tracking/sendReq.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
function pad($strValue = "", $lengthOf = 0, $specialChar = "0", $appendMode = "left") {
|
||||
if ($lengthOf == 0 || ($appendMode != "left" && $appendMode != "right")) :
|
||||
return trim($strValue);
|
||||
endif;
|
||||
|
||||
$len = strlen($strValue);
|
||||
for ($i = $len; $i < $lengthOf; $i++) :
|
||||
if ($appendMode == "left") :
|
||||
$strValue = $specialChar . $strValue;
|
||||
else :
|
||||
$strValue = $strValue . $specialChar;
|
||||
endif;
|
||||
endfor;
|
||||
return $strValue;
|
||||
}
|
||||
|
||||
$trackingUserID = "stbx";
|
||||
$trackingPassword = "cagtmv2924";
|
||||
|
||||
|
||||
$req = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
||||
$req .= "<AmazonTrackingRequest xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"AmazonTrackingRequest.xsd\">";
|
||||
$req .= "<Validation><UserID>" . $trackingUserID . "</UserID><Password>" . $trackingPassword . "</Password></Validation><APIVersion>3.1</APIVersion>";
|
||||
for ($i = 1; $i <= 2; $i++) :
|
||||
$testID = "test" . pad($i, 4, "0");
|
||||
$req .= "<TrackingNumber>" . $testID . "</TrackingNumber>";
|
||||
endfor;
|
||||
$req .= "</AmazonTrackingRequest>";
|
||||
|
||||
$req = urlencode($req);
|
||||
|
||||
header("Location: tracking_amazon.php?trackingReq=" . $req);
|
||||
?>
|
||||
Reference in New Issue
Block a user