donljt2606 2016-07-08 05:30
浏览 29

“消息:尝试获取非对象属性”的解决方案

I am not so much into coding; I just would like to make a simple php application run on my local XAMPP. Everytime I want to login I get the following two notices:

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: controllers/login.php

Line Number: 47

Second one directly below the first:

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: controllers/login.php

Line Number: 49

Having a look at lines 47 to 49 does not help me as I do not get the essence of the error notice:

        $this->status = $rsp->data->status;

        if($this->status->OK){

It wopuld be greatly appricaited of you could give me a hint what do you. I had a look at fice other "codeigniter Message: Trying to..." questions but I couldn't transfer the answers to my specific case.

All the best Alex

  • 写回答

1条回答 默认 最新

  • duanpu8830 2016-07-08 05:36
    关注

    Add following code into your index.php which is located in root directory

    if it is development server

    error_reporting(E_ERROR);
    ini_set('display_errors', 1);  
    

    if it is production server

    error_reporting(0);
    ini_set('display_errors', 0); 
    
    if(isset($this->status->OK)&&$this->status->OK)
    
    评论

报告相同问题?

悬赏问题

  • ¥15 【提问】基于Invest的水源涵养
  • ¥20 微信网友居然可以通过vx号找到我绑的手机号
  • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
  • ¥15 解riccati方程组
  • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
  • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题