doutong1890 2014-09-23 19:10
浏览 71
已采纳

常量联系:错误消息 - 未定义的偏移量:cc class.php中的1

I'm using PHP class from https://github.com/constantcontact/Constant-Contact-PHP-Sample-Contact-Forms to add new contacts to Constant Contact list, but recently I have got PHP error messages:

A PHP Error was encountered 
Severity: Notice 
Message: Undefined offset: 1 
Filename: cc_class.php 
Line Number: 248

A PHP Error was encountered
Severity: Notice
Message: Undefined offset: 1
Filename: cc_class.php
Line Number: 252

where those lines look like:

(248)

$xml = simplexml_load_string($return);

(252)

}

and full related function to those two lines:

public  function subscriberExists($email = '') {
   $call = $this->apiPath.'/contacts?email='.$email;
   $return = $this->doServerCall($call);
   $xml = simplexml_load_string($return);
   $id = $xml->entry->id;
   if($id){ return $id; }
   else { return false; }
}

but it passes data to Constan Contact anyway.

Any clue what is going on there with those error messages?

Thanks

  • 写回答

1条回答 默认 最新

  • dongyun8138 2014-09-29 20:46
    关注

    From the class GitHub

    This is just a PHP notice, not a failure, when trying to access an index of an array that hasn't been defined yet. The codebase in this app is fairly old, and hasn't been brought up to date as PHP is upgraded.

    We would recommend instead of using this repo, utilizing the newer PHP SDK which is object-oriented, available via composer, and kept up to date. You can definitely mute these notifications in your environment, but this repo is deprecated, so this issue won't be addressed in the project.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?