0

Kindly help me, i am fresher in codeigniter.

if( $this->form_validation->run('add_profile_rules') && !empty($this->upload->do_upload('profile_image')) ) { // this is error line of My code

and error is on live server but on local server it is working and on another live server it is working

public function update_profile($employee_id) {

        $config = [
            'upload_path' => './uploads/profiles/',
            'allowed_types' => 'jpg|gif|png|jpeg'
        ];
        $this->load->library('upload', $config);

        $this->upload->display_errors();

        $this->load->library('form_validation');

        $this->form_validation->set_error_delimiters('<p class="text-danger">', '</p>');

        if( $this->form_validation->run('add_profile_rules') && !empty($this->upload->do_upload('profile_image')) ) { // this is error line of My code

            $post = $this->input->post();
            unset($post['submit']);

            $data = $this->upload->data();

            $image_path = "uploads/profiles/" . $data['raw_name'] . $data['file_ext'];

            $post['profile_image'] = $image_path;

            $this->load->model('Profile_model', 'profile');

            if( $this->profile->update_profile($employee_id, $post) ) {
                $this->session->set_flashdata('feedback', "Profile Updated Successfully.");
                $this->session->set_flashdata('feedback_class', 'alert-success');
            } else {
                $this->session->set_flashdata('feedback', "Profile Failed to Update, Please Try Again");
                $this->session->set_flashdata('feedback_class', 'alert-danger');
            }
            return redirect('admin/dashboard');

        } else {
            $this->load->view('admin/edit_profile');
        }

    }
Zedex7
  • 1,624
  • 1
  • 12
  • 21
Mohd Atiq
  • 151
  • 1
  • 13

0 Answers0