Re: PHP and FedEX
| From: | callen | Date: | Fri, 01 Dec 2000 17:31:21 +0000 |
| Subject: | Re: PHP and FedEX | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28236@lists.php.net to get a copy of this message | ||
kmurrah wrote:
>
> Greetings.
>
> Has anyone used the FedEx API or any other method for adding FedEx shipping
> data to a page?
>
> Thanks in advance.
Here's a basic entry point into your problem:
$fp = fopen
("http://grd.fedex.com/cgi-bin/rrr2010.exe?func=Rate&Screen=Ground&OriginZip=54025&OriginCountryCode=US&DestZip=$new_zip&DestCountryCode=US&Weight=$w_total",
"r");
if(!$fp)
{
echo "Didnt open <br> $errstr ($errno)<br>\n";
}
else
{
fputs($fp,"GET / HTTP/1.0\n\n");
while(!feof($fp))
{
$buffer=fgets($fp,100);
if ( ereg (
"^(<\!TotalCharges>)([0-9]{1,4})(\.)([0-9]{1,})", $buffer, $regs))
{
$fee .=$regs[2];
$fee .=$regs[3];
$fee .=$regs[4];
}
etc....
--
Christopher C.M. Allen