Answers for "script generate tracking number ups by post"

PHP
0

script generate tracking number ups by post

<?php
function upsTrack($trackingNumber) {
$data ="<?xml version=\"1.0\"?>
<AccessRequest xml:lang='en-US'>
  <AccessLicenseNumber>ACCESSNUMBER</AccessLicenseNumber>
  <UserId>USERNAME</UserId>
  <Password>PASSWORD</Password>
</AccessRequest>
<?xml version=\"1.0\"?>
<TrackRequest>
  <Request>
    <TransactionReference>
      <CustomerContext>
        <InternalKey>blah</InternalKey>
      </CustomerContext>
      <XpciVersion>1.0</XpciVersion>
    </TransactionReference>
    <RequestAction>Track</RequestAction>
  </Request>
  <TrackingNumber>$trackingNumber</TrackingNumber>
</TrackRequest>";
$ch = curl_init("https://www.ups.com/ups.app/xml/Track");
Posted by: Guest on November-15-2020
0

script generate tracking number ups by post

$ch = curl_init("https://www.ups.com/ups.app/xml/Track");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch,CURLOPT_POST,1);
curl_setopt($ch,CURLOPT_TIMEOUT, 60);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch,CURLOPT_POSTFIELDS,$data);
$result=curl_exec ($ch);
// echo '<!-- '. $result. ' -->';
$data = strstr($result, '<?');
Posted by: Guest on November-15-2020

Browse Popular Code Answers by Language