ID: 21322 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Output Control Operating System: Red Hat Linux 7.1 PHP Version: 4.3.0 New Comment:
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the existing bug instead. Thank you for your interest in PHP. You already submitted this error (bugreport #21023 which has status feedback!) Previous Comments: ------------------------------------------------------------------------ [2003-01-01 15:39:10] [EMAIL PROTECTED] Version 4.3.0 has the following problem. I have develpoed a script that works with the www.ups.com cgi script to calculate a shipping rate. The script is having trouble outputing the entire "string" that is out puted by the http://www.ups.com/using/services/rave/qcost_dss.cgi file. I have been using this script for two years and have never had this problem. ##This is a pre-configured United Parcel Service script.## <? //Strings for the shipping calculator. $codes = "POST /using/services/rave/qcost_dss.cgi HTTP/1.0\n"; $codes .= "Content-type: application/x-www-form-urlencoded\n"; $codes .= "Content-length: 271\n\n"; $codes .= "AppVersion=1.2&"; $codes .= "AcceptUPSLicenseAgreement=YES&"; $codes .= "ResponseType=application/x-ups-rss&"; $codes .= "ActionCode=3&"; $codes .= "ServiceLevelCode=GND&"; $codes .= "RateChart=Regular+Daily+Pickup&"; $codes .= "ShipperPostalCode=48235&"; $codes .= "ConsigneePostalCode=48221&"; $codes .= "ConsigneeCountry=US&"; $codes .= "PackageActualWeight=1&"; $codes .= "ResidentialInd=0&"; $codes .= "PackagingType=00\n\n"; //Open a socket to ups.com to get shipping rates. $open_sock = fsockopen("www.ups.com",80, $errno, $errstr,10); if(!($open_sock)){ die("Can not open Socket"); } else { while(!(feof($open_sock))){ fputs($open_sock, $codes); while($line = fgets($open_sock, 1000)){ $contents .= $line; $check_out_find_rate = explode("%", $contents); break; } } } //if the shipping rate can not be found the script dies and directs the user to a error page. if($check_out_find_rate[14] == false){ fclose($open_sock); die("$codes <br><br> $contents"); } else{ echo "$contents"; fclose($open_sock); } ?> ######Normaly this script out puts the following stings.#### HTTP/1.1 200 OK Server: Netscape-Enterprise/6.0 Date: Sun, 15 Dec 2002 04:21:03 GMT Content-type: multipart/mixed;boundary=UPSBOUNDARY Content-length: 267 Connection: close POST /using/services/rave/qcost_dss.cgi HTTP/1.0 Content-type: application/x-www-form-urlencoded Content-length: 270 AppVersion=1.2&AcceptUPSLicenseAgreement=YES&ResponseType=application/x-ups-rss&ActionCode=3&ServiceLevelCode=GND&RateChart=Regular+Daily+Pickup&ShipperPostalCode=55428&ConsigneePostalCode=48235&ConsigneeCountry=US&PackageActualWeight=2&ResidentialInd=0&PackagingType=00 <HTML> <BODY> </BODY> </HTML> --UPSBOUNDARY Content-type: application/x-ups-rss Content-length: 78 UPSOnLine%1.2%0000%0000Success%3%GND%55428%US%48235%US%004%2%3.92%0.00%3.92%-1 --UPSBOUNDARY-- #####Notice that 3.92 is the actual shipping rate.##### PHP Version 4.3.0 only out puts the first line which is: HTTP/1.1 200 OK I love PHP but version 4.3.0 is very bugy. Please fix this bug. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21322&edit=1