PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > Have you used the USPS API?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Have you used the USPS API?

Réponse
 
LinkBack Outils de la discussion
Vieux 27/11/2007, 21h55   #1
laredotornado@zipmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Have you used the USPS API?

Hi,

I just downloaded class.usps.php by Adam Globus-Hoenich. Sadly, I'm
getting some errors on the default test case. I've changed nothing in
the test and only filled in the dummy values for the test example.
Here's my code and the warnings and empty output follow. Any ideas
what I'm missing or what is wrong with the supplied code?

===Code from test case =====
require "class.usps.php";
$usps = new USPS("username", "password", "Verify");
$package = array(
'address1' => '',
'address2' => '8 Wildwood Drive',
'city' => 'Old Lyme',
'state' => 'CT',
'zip5' => '06371',
'zip4' => '',
);

if(!$usps->add_package($package)) die("Failed to add the package");

$usps->submit_request();
$err = $usps->get_package_error();
if ($err) {
echo "<pre>"rint_r($err);echo "</pre>";
} else {
$arr['a1'] = $usps->get_address1();
$arr['a2'] = $usps->get_address2();
$arr['zip4'] = $usps->get_zip4();
$arr['zip5'] = $usps->get_zip5();
$arr['city'] = $usps->get_city();
$arr['state'] = $usps->get_state();
echo "<pre>"rint_r($arr);echo "</pre>";
}
echo "end";


====Output====
Notice: Undefined offset: 0 in /usr/local/apache2/htdocs/dhlovelife/v2/
class.usps.php on line 473
Notice: Undefined offset: 0 in /usr/local/apache2/htdocs/dhlovelife/v2/
class.usps.php on line 443
Notice: Undefined offset: 0 in /usr/local/apache2/htdocs/dhlovelife/v2/
class.usps.php on line 448
Notice: Undefined offset: 0 in /usr/local/apache2/htdocs/dhlovelife/v2/
class.usps.php on line 468
Notice: Undefined offset: 0 in /usr/local/apache2/htdocs/dhlovelife/v2/
class.usps.php on line 463
Notice: Undefined offset: 0 in /usr/local/apache2/htdocs/dhlovelife/v2/
class.usps.php on line 453
Notice: Undefined offset: 0 in /usr/local/apache2/htdocs/dhlovelife/v2/
class.usps.php on line 458

Array
(
[a1] =>
[a2] =>
[zip4] =>
[zip5] =>
[city] =>
[state] =>
)

end

Thanks, - Dave
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h43.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09436 seconds with 9 queries