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 虚拟机打包apk出现错误
  • ¥30 最小化遗憾贪心算法上界
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝