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 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据