Here is my controller function as far as i can see there is no error but it still showing me this message .what does it mean .
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class User extends CI_Controller { public function __construct() { parent::__construct(); // Your own constructor code //$this->load->model('user_model'); } public function index() { $this->load->view('user/signup'); } public function registration() { if($this->input->post()) { $fullname=$this->input->post('fullname'); $fullnameSplit= explode(" ", $fullname); $reg_data = array( 'membershipid'=>"Ls-".rand(), 'role'=>1, 'firstname'=>$fullnameSplit[0], 'middlename'=>$fullnameSplit[1], 'lastname'=>$fullnameSplit[2], 'Company_name'=>$this->input->post('companyname'), 'email'=>$this->input->post('email'), 'password'=>sha1($this->input->post('password')), ); print_r($reg_data); //$this->user_model->register_user($reg_data); //redirect('user/login'); //echo '<pre>'; print_r($reg_data); die; }else { //$data['current_page'] = 'Register'; //$this->load->view('registration',$data); } } }
This error is showing .
A PHP Error was encountered Severity: Notice Message: Undefined offset: 2 Filename: controllers/User.php Line Number: 35 Backtrace: File: /var/www/overtribe.com/public_html/listspread/application/controllers/User.php Line: 35 Function: _error_handler File: /var/www/overtribe.com/public_html/listspread/index.php Line: 293 Function: require_once
print_r($reg_data);- Sanjuktha$f_name,$m_name,$l_nameand in controller check those if not empty before using them. - Tpojka