Guest benlogan Posted September 24, 2005 Share Posted September 24, 2005 Hi, I have a url, which works out postage accoring to destination, weight etc.. here is the url $url = "http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=$frompcode&Destination_Postcode=$topcode&Country=$dest_country&Weight=$sweight&Service_Type=ECONOMY&Height=$sheight&Width=$swidth&Length=$slength&Quantity=$shipping_num_boxes"; entering this in your browser http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=3793&Destination_Postcode=3867&Country=AU&Weight=5&Service_Type=STANDARD&Height=100&Width=100&Length=100&Quantity=1 will diplay charge=3.6 days=2 err_msg=OK. I would like to integrate that into the flat rate part of cube cart. bu i dont know how to store the "charge" integer. thanks. Quote Link to comment Share on other sites More sharing options...
Guest fiddy Posted September 24, 2005 Share Posted September 24, 2005 function getPostCharge($posturl) { $all = file_get_contents($posturl); $bits = preg_match('/charge=(\\d*\\.?\\d*)/',$all,$out); return $out[1]; } $postcharge = getPostCharge("http://drc.edeliver.com.au/ratecalc.asp?Pickup_Postcode=3793&Destination_Postcode=3867&Country=AU&Weight=5&Service_Type=STANDARD&Height=100&Width=100&Length=100&Quantity=1"); http://uk.php.net/preg_match PS: 3.6 is a double or floating point number, rather than an integer. Quote Link to comment Share on other sites More sharing options...
Guest benlogan Posted September 25, 2005 Share Posted September 25, 2005 Hey, Thanks, that worked perfectly. Quote Link to comment Share on other sites More sharing options...
Guest fiddy Posted September 25, 2005 Share Posted September 25, 2005 Happy to help Quote Link to comment Share on other sites More sharing options...
Guest benlogan Posted September 25, 2005 Share Posted September 25, 2005 are you able to help me with something else? it is the post php if statements greatly appreciated if you have a solution. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.