$dnum=date(Ymd)*4; $QID=$_POST['QID']; $CID=$_POST['CID']; $usrn=$_POST['usrn']; $usr=$_POST['usr']; $item=$_POST['item']; $handling=$_POST['handling']; $shipType=$_POST['shipType']; $sendZipcode=$_POST['o_code']; $recieveZipcode=$_POST['recievezipcode']; $recieveCountry="US"; $weight=$_POST['weight_lb']; $res=$_POST['res']; $quantity=$_POST['quantity']; $crr_phone=$_POST['crr_phone']; print getUPSprice($shipType,$sendZipcode,$recieveZipcode,$recieveCountry,$weight); function getUPSprice($shipType,$sendZipcode,$recieveZipcode,$recieveCountry,$weight) { $tmp = "AppVersion=1.2&AcceptUPSLicenseAgreement=yes&ResponseType=application/x-ups-rss&ActionCode=3". "&RateChart=Regular+Daily+Pickup&DCISInd=0&SNDestinationInd1=0&SNDestinationInd2=0&ResidentialInd= echo $res; ?>&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." . " |
" . "UPS Price for: ($quantity) $item, $how, $place" . " |
$total" .
" Click "ADD TO QUOTE" to Update Quote." . " |