[eluser]ranjitbd[/eluser]
Code:
// this is the controller method from where i called a function from helper file
function service_provider_add_do()
{
global $data;
$data['name'] = $this->input->post('name', TRUE);
$data['service_type'] = $this->input->post('service_type', TRUE);
$data['contact_person'] = $this->input->post('contact_person', TRUE);
$data['address'] = $this->input->post('address', TRUE);
$data['city'] = $this->input->post('city', TRUE);
$data['zip_code'] = $this->input->post('zip_code', TRUE);
$data['state'] = $this->input->post('state', TRUE);
$data['country'] = $this->input->post('country', TRUE);
$data['date_time'] = date('Y-m-d H:i:s');
$data['session_id'] = $this->session->userdata('session');
$result = $this->admin_model->service_provider_add_do($data);
flag_message($result, 'admin/admin/service_provider_add');
}
// if i write flag_message() method inside the controller it works fine..
//this is the function inside my helper file
function flag_message($result, $page = NULL)
{
if($page)
{
$saved = 'Data Save Successfully';
$fails = 'Data Failed';
if($result)
{
$menu_data = array
(
'message' => $saved,
'add' => TRUE
);
$this->session->set_userdata($menu_data); // this is line 103
// showing Parse error is the above line......................................
redirect($page);
}
else
{
$menu_data = array
(
'message' => $fail,
'add' => FALSE
);
$this->session->set_userdata($menu_data);
redirect($page);
}
}
redirect('admin/admin/logout');
}
// Parse error: parse error in C:\xampp\htdocs\travelmartbd\system\helpers\common_function_helper.php on line 103
// what is wrong here...