Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

URGENT: "Message too long" error in _usps.php


danielj

Recommended Posts

My site has been working fine on the March 4 snapshot of 2.2 that I have been running (I have made too many mods to deal with upgrading to a later snapshot yet).

 

This morning, this is the error if you click checkout, but nothing on the server has changed. I'm running PHP 4.2.1, Apache 1.3.24, MySQL 3.23.46, FreeBSD 4.3:

 

Warning: fopen("http://Production.ShippingAPIs.com/ShippingAPI.dll?API=Rate&XML=%3CRateRequest+USERID%3D%XXXXXXXXX%22+PASSWORD%3D%XXXXXXXXXXXXXX%22%3E%3CPackage+ID%3D%220%22%3E%3CService%3EExpress%3C%2FService%3E%3CZipOrigination%3E33701%3C%2FZipOrigination%3E%3CZipDestination%3E98122%3C%2FZipDestination%3E%3CPounds%3E0%3C%2FPounds%3E%3COunces%3E11%3C%2FOunces%3E%3CContainer%3ENone%3C%2FContainer%3E%3CSize%3EREGULAR%3C%2FSize%3E%3CMachinable%3EFalse%3C%2FMachinable%3E%3C%2FPackage%3E%3C%2FRateRequest%3E", "r") - Message too long in /www/htdocs/www.sufferware.com/osc/includes/classes/_usps.php on line 115

 

Here is the code. I marked line 115:

 

 

function getPrice() {

$str = '<RateRequest USERID="' . $this->user . '" PASSWORD="' . $this->pass . '">';

$str .= '<Package ID="0">';

$str .= '<Service>' . $this->service . '</Service>';

$str .= '<ZipOrigination>' . $this->orig_zip . '</ZipOrigination>';

$str .= '<ZipDestination>' . $this->dest_zip . '</ZipDestination>';

$str .= '<Pounds>' . $this->pounds . '</Pounds>';

$str .= '<Ounces>' . $this->ounces . '</Ounces>';

$str .= '<Container>' . $this->container . '</Container>';

$str .= '<Size>' . $this->size . '</Size>';

$str .= '<Machinable>' . $this->machinable . '</Machinable>';

$str .= '</Package>';

$str .= '</RateRequest>';

$str = $this->server . '?API=Rate&XML=' . urlencode($str);

 

115: $fp = fopen($str, "r");

if (!$fp) {

$body = 'Connection Failed';

} else {

while(!feof($fp)){

$result = fgets($fp, 500);

$body.=$result;

}

fclose($fp);

}

 

 

The site is http://www.sufferware.com/osc (we sell adult toys - be warned).

 

Any help is most appreciated, as we cannot take any orders!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...