Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 8th, 2011  |  syntax: PHP  |  size: 0.64 KB  |  views: 84  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Connect to Australia Post to retrieve a live shipping quote
  2. $validQuote = false;
  3. $ausPostURL = 'http://drc.edeliver.com.au/ratecalc.asp?';
  4. $postVars = array(
  5.         'Height' => $height,
  6.         'Length' => $length,
  7.         'Width' => $width,
  8.         'Weight' => $weight,
  9.         'Quantity' => 1,
  10.         'Pickup_Postcode' => $this->_origin_zip,
  11.         'Destination_Postcode' => $this->_destzip,
  12.         'Country' => $this->_destcountry,
  13.         'Service_Type' => $this->_deliverytype
  14. );
  15.  
  16. $postRequest = '';
  17. foreach($postVars as $k => $v) {
  18.         $postRequest .= '&'.$k.'='.urlencode($v);
  19. }
  20. $postRequest = ltrim($postRequest, '&');
  21.  
  22. $result = PostToRemoteFileAndGetResponse($ausPostURL, $postRequest);
clone this paste RAW Paste Data