-1

When I load my application for the first time I get the following error

A PHP Error was encountered
Severity: Notice

Message: Undefined index: user_full_name

Filename: templates/header.php

Line Number: 85

Backtrace:

File: /home/xyz/app/application/views/templates/header.php
Line: 85
Function: _error_handler

Code in view

<? if ($this->session->userdata['user_full_name'] == "" || $this->session->userdata['user_full_name'] == null): ?>
something something 

Controller

public function __construct() {

    parent::__construct();
    $this->load->library('session');
    $this->load->model('home_model');
    $this->load->model('user_model');        
}

Why is this happening. Why do I get an error stating the variable is not recognized

thanks Krish

krish_cloudnow
  • 180
  • 1
  • 13

1 Answers1

0

As mentioned by Clive above I did the following change to rectify the error

Change this

<? if ($this->session->userdata['user_full_name'] == "" || $this->session->userdata['user_full_name'] == null): ?>

to

<? if (!isset($this->session->userdata['user_full_name'])): ?>
krish_cloudnow
  • 180
  • 1
  • 13