&PackagingType=00". "&ServiceLevelCode=$shipType&ShipperPostalCode=".substr($sendZipcode, 0, 5)."&ConsigneePostalCode=". substr($recieveZipcode, 0, 5). "&ConsigneeCountry=$recieveCountry&PackageActualWeight=$weight&DeclaredValueInsurance=0\n\r"; $request = "POST /using/services/rave/qcost_dss.cgi HTTP/1.0\nContent-type: application/x-www-form-urlencoded\nContent-length: " . strlen($tmp) . "\n\n" . $tmp; $this1->socket = fsockopen("www.ups.com", 80); fputs($this1->socket, $request); strtok(fread ($this1->socket, 4096), "%"); for ($i = 0; $i < 12 ;$i++){ global $price; $price = strtok("%"); } fclose($this1->socket); echo("

"); return($price); } $total = $price * $quantity; if($total=="" or $total<1){ echo("" . "" . "
" . "Unable to calculate shipping automatically." . "
Click "GO" to Enable Manual input." . "
Look for shipping information in Quote Notes." . "
" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "
"); }else{//got total if($res=="1"){ $place="Residential"; $pla="Res"; }else{ $place="Commercial"; $pla="Com"; } if($shipType=="2DA"){ $how="2 Day Air"; }else{ $how="Ground"; } $shipconfig=$shipType.":".$pla; echo("" . "" . "
" . "UPS Price for: ($quantity) $item, $how, $place" . "
$total" . "
Click "ADD TO QUOTE" to Update Quote." . "
" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "
"); }//got total ?>