Jump to content



  • Please log in to reply
No replies to this topic

#1 khan kaka

khan kaka
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts
  • Locationaustralia

Posted 07 July 2006 - 04:12 AM

i am realy stuck with this can some one please help me.

These instructions describe how to link the Post eDeliver Delivery Rate Calculator (DRC) to a Merchant web site via an HTTP request. 

The DRC estimates delivery charges and times for parcels dispatched via the Australia Post network, allowing Merchants to pass this information to their customers as they browse the Merchant’s product catalogue and place orders. 

Services for which the DRC provides estimates are : 
· Domestic parcels : Regular or Express Post parcels
· International parcels : Air, Economy or Sea parcels

These instructions are for web sites built using PHP scripting language versions 3 and 4.


Send the following code to the DRC :


Example of PHP query to obtain data for above code

$qs .= 'Height='.$HTTP_POST_VARS["Height"].'&';
$qs .= 'Length='.$HTTP_POST_VARS["Length"].'&';
$qs .= 'Width='.$HTTP_POST_VARS["Width"].'&';
$qs .= 'Weight='.$HTTP_POST_VARS["Weight"].'&';
$qs .= 'Pickup_Postcode='.$HTTP_POST_VARS["Pickup_Postcode"].'&';
$qs .= 'Destination_Postcode='.$HTTP_POST_VARS["Destination_Postcode"].'&';
$qs .= 'Country='.$HTTP_POST_VARS["Country"].'&';
$qs .= 'Service_Type='.$HTTP_POST_VARS["Service_Type"].'&';
$qs .= 'Quantity='.$HTTP_POST_VARS["Quantity"]; .

Please note

It is recommended that Merchants with domestic deliveries only preset the Country Code to “AU” (Australia).

When the $myfile=file('http://drc.edeliver.com.au/ratecalc.asp?'.$qs) enquiry is executed by the DRC the results are placed into an array called $myfile. The name/value pairs of the results are returned as per this example:

charge=2.74 days=2 err_msg=OK

· charge = the estimated delivery charge in $AUS;
· days = the estimated transit time in business days through the Australia Post delivery network from time of lodgement with Australia Post to time of delivery;
· err_msg  = a message verifying that the data sent is correct (“OK”) or notifying data errors detected (Eg “Item girth outside valid ranges”).


PHP’s  “split()” function is used to retrieve the values returned by the DRC.

Merchants may manipulate the results to suit the needs of Consumers and the requirements of their Web page design. Ie Merchants can select which parts of the results to display (Eg delivery time may be displayed and delivery charge ignored), alter the data returned (Eg to add a margin to the delivery charge estimate or to add order processing time in the Merchant’s warehouse to the delivery time estimate) and set the format used to display the results.


$x = split('=',$myfile[0]) splits the data pair line into items separated by the “=” sign, resulting in an array called $x with values, which can be displayed.  Using the example above, the first data pair could be split, manipulated and displayed as follows:

$x[0] = "charge" and $x[1] = 2.74

echo "The charge is $".$x[1];

The next two data pairs ( $myfile[1] and $myfile[2] ) can be split, manipulated and displayed in the same way.

when i run this code all in one page it get an error message.

can some one please explain to me how this work.

your help very important to me 

thanks in advance

khan kaka

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users