Quote
ACTIVATING THE DRC USING PHP 3 OR 4
If you use PHP scripting Version 3 OR 4, build the following code:
$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);
(Note: The box in grey should be built into one line)
Example
The PHP codes may look like the following:
$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"]; .
back to top
ACCESSING THE RATE CALCULATOR ON AUSTRALIA POST EDELIVER WEBSITE
Post the following values to:
http://drc.edeliver.com.au/ratecalc.asp
Programs needs to perform an http request on this page with the following values
Pickup_Postcode=<string: 4 chars>
Destination_Postcode=<string: 4 chars>
Country=<string: 2 chars>
Weight=<integer>
Service_Type=<'STANDARD','EXPRESS','AIR','SEA','ECONOMY'>
Length=<integer>
Width=<integer>
Height=<integer>
Quantity=<integer>
back to top
GETTING THE RESULTS
When you execute the $myfile=file('http://drc.edeliver.com.au/ratecalc.asp?'.$qs); the results returned are placed into an array called $myfile. The name/value pairs of the results are returned on separate lines, so what you end up with is an array with three elements, which would look like:
charge=2.50
days=1
err_msg=OK
The last component contains error messages to inform customers they have made errors when entering the data (e.g. Invalid weight). Displaying the error helps to prompt customers to re-enter required information.
Displaying the results on your website
Depending on your Web page design, it is up to you how to display the results of the delivery charge estimation to your customers. You will be able to select what information you want displayed in a format you prefer.
You can use PHP's split ( ) function to retrieve the values returned.
Example
$x = split('=',$myfile[0])
This splits the first line into items separated by the '=' sign, resulting in an array called $x with values:
$x[0] = "charge" and $x[1] = 2.74
echo "The charge is $".$x[1];
Similarly, you are able to split on the next two lines ( $myfile[1] and $myfile[2] )
If you use PHP scripting Version 3 OR 4, build the following code:
$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);
(Note: The box in grey should be built into one line)
Example
The PHP codes may look like the following:
$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"]; .
back to top
ACCESSING THE RATE CALCULATOR ON AUSTRALIA POST EDELIVER WEBSITE
Post the following values to:
http://drc.edeliver.com.au/ratecalc.asp
Programs needs to perform an http request on this page with the following values
Pickup_Postcode=<string: 4 chars>
Destination_Postcode=<string: 4 chars>
Country=<string: 2 chars>
Weight=<integer>
Service_Type=<'STANDARD','EXPRESS','AIR','SEA','ECONOMY'>
Length=<integer>
Width=<integer>
Height=<integer>
Quantity=<integer>
back to top
GETTING THE RESULTS
When you execute the $myfile=file('http://drc.edeliver.com.au/ratecalc.asp?'.$qs); the results returned are placed into an array called $myfile. The name/value pairs of the results are returned on separate lines, so what you end up with is an array with three elements, which would look like:
charge=2.50
days=1
err_msg=OK
The last component contains error messages to inform customers they have made errors when entering the data (e.g. Invalid weight). Displaying the error helps to prompt customers to re-enter required information.
Displaying the results on your website
Depending on your Web page design, it is up to you how to display the results of the delivery charge estimation to your customers. You will be able to select what information you want displayed in a format you prefer.
You can use PHP's split ( ) function to retrieve the values returned.
Example
$x = split('=',$myfile[0])
This splits the first line into items separated by the '=' sign, resulting in an array called $x with values:
$x[0] = "charge" and $x[1] = 2.74
echo "The charge is $".$x[1];
Similarly, you are able to split on the next two lines ( $myfile[1] and $myfile[2] )
Anyone know how to apply this for a version 3 AusPost module?










