The Grinch Posted April 22, 2003 Share Posted April 22, 2003 I seem to be a bug in the Canada Post shipping module. Or maybe it's just not compatible with the snapshot I'm using. The Canada Post server seems to be dead tonight. When I click checkout, it clocks for a while with no response, then I get this on my screen: Warning: fputs(): supplied argument is not a valid File-Handle resource in /var/www/catalog/includes/modules/shipping/canadapost.php on line 183 Warning: fputs(): supplied argument is not a valid File-Handle resource in /var/www/catalog/includes/modules/shipping/canadapost.php on line 184 Warning: fputs(): supplied argument is not a valid File-Handle resource in /var/www/catalog/includes/modules/shipping/canadapost.php on line 185 Warning: fputs(): supplied argument is not a valid File-Handle resource in /var/www/catalog/includes/modules/shipping/canadapost.php on line 186 Warning: fputs(): supplied argument is not a valid File-Handle resource in /var/www/catalog/includes/modules/shipping/canadapost.php on line 189 Warning: fputs(): supplied argument is not a valid File-Handle resource in /var/www/catalog/includes/modules/shipping/canadapost.php on line 191 Warning: feof(): supplied argument is not a valid File-Handle resource in /var/www/catalog/includes/modules/shipping/canadapost.php on line 193 Warning: fgets(): supplied argument is not a valid File-Handle resource in /var/www/catalog/includes/modules/shipping/canadapost.php on line 194 I have no clue what it all means. Here's the code starting at line 172: /* using HTTP/POST send message to canada post server */ function _sendToHost($host,$port,$method,$path,$data,$useragent=0) { // Supply a default method of GET if the one passed was empty if (empty($method)) $method = 'GET'; $method = strtoupper($method); $fp = fsockopen($host,$port); if ($method == 'GET') $path .= '?' . $data; fputs($fp, "$method $path HTTP/1.1n"); fputs($fp, "Host: $hostn"); fputs($fp, "Content-type: application/x-www-form-urlencodedn"); fputs($fp, "Content-length: " . strlen($data) . "n"); if ($useragent) fputs($fp, "User-Agent: MSIEn"); fputs($fp, "Connection: closenn"); if ($method == 'POST') fputs($fp, $data); while (!feof($fp)) $buf .= fgets($fp,128); fclose($fp); return $buf; } Link to comment Share on other sites More sharing options...
bd4rr Posted April 25, 2003 Share Posted April 25, 2003 Fixed. Download new version (v0.2.2) here: http://www.oscommerce.com/community/contributions,391 Kenneth Wang VA3RRW/BD4RR Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.