If you use PHP scripting Version 3 OR 4, build the following code:
(Note: The box in grey should be built into one line)
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:
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>
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:
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.
$x = split('=',$myfile)
This splits the first line into items separated by the '=' sign, resulting in an array called $x with values:
$x = "charge" and $x = 2.74
echo "The charge is $".$x;
Similarly, you are able to split on the next two lines ( $myfile and $myfile )
Anyone know how to apply this for a version 3 AusPost module?