A PHP Error was encountered - Message: Undefined index: title - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: A PHP Error was encountered - Message: Undefined index: title (/showthread.php?tid=72844) |
A PHP Error was encountered - Message: Undefined index: title - Porto - 02-18-2019 Hello Guys, could someone give a Light please, what i am doing wrong here? Thanks in Advance! This is my Post Controller: Code: // LOAD POST INDIVIDUALLY and this the view file: Code: <h2><?php echo $post['posts_title']; ?></h2> and this is the error message on the browser: A PHP Error was encountered Severity: Notice
Message: Undefined index: title
Filename: controllers/Posts.php
Line Number: 59
Backtrace:
File: C:\xampp\htdocs\dogs\application\controllers\Posts.php
File: C:\xampp\htdocs\dogs\index.phpLine: 59 Function: _error_handler Line: 315 Function: require_once RE: A PHP Error was encountered - Message: Undefined index: title - ciadmin - 02-18-2019 The only place in the controller code you show, that references an index "title", is Code: $data['title'] = $data['post']['title']; The error message suggests that $data['post'], which you get from Code: $this->Post_model->get_posts($slug); This sounds like the problem lies in your Post_model, or in the datait is retrieving. RE: A PHP Error was encountered - Message: Undefined index: title - Porto - 02-19-2019 (02-18-2019, 09:24 PM)ciadmin Wrote: The only place in the controller code you show, that references an index "title", is Thank you so much Mr.Admin.... As solution i just removed the line under and all the things works fine! Code: $data['title'] = $data['post']['title']; Thank you so much for the Light! RE: A PHP Error was encountered - Message: Undefined index: title - Porto - 02-19-2019 Please, on this Forum, how can i give the Topic as completed or done? RE: A PHP Error was encountered - Message: Undefined index: title - php_rocs - 02-19-2019 @Porto, You can add the following text to the title '[SOLVED]'. You can also click the +Rate button to give ciadmin credit for helping you. RE: A PHP Error was encountered - Message: Undefined index: title [SOLVED] - Porto - 02-19-2019 (02-19-2019, 07:41 AM)php_rocs Wrote: @Porto, Thank you @php_rocs! Done! |