Jump to content

Recommended Posts

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
------------------------------------------------------------------
INSTRUCTIONS : PHP

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

1  ACTIVATING THE DRC

Send the following code to the DRC :

$myfile=file('http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode='.$var_pickup.'&Destination_Postcode='.$var_destination.'&Country='.$var_country.'&Weight='.$var_weight.'&
Service_Type='.$var_service.'&Length='$var_length.'&Width='.$var_width.'&Height='.$var_height.'&Quantity='.$var_quantity);


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).


2  INTERPRETING THE RESULTS
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

Where:
· 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”).


3  DISPLAYING THE RESULTS

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.

Example

$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
Link to comment
https://forums.phpfreaks.com/topic/13922-post-edeliver-delivery-rate-calculator/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.