Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to a member funtion on a non-object
#1

[eluser]swissbastian[/eluser]
Hi there

I've got some serious problems with some of my controllers. What makes me crazy is the fact, that it all worked fine and suddenly causes this fatal error.

The controller function:
Code:
function passwort()
    {
        if ($this->input->post('passwort_bearbeiten')) {
        
            $rules['passwort1']    = "trim|required|min_length[4]|matches[passwort2]|md5";
            $rules['passwort2']    = "trim|required|min_length[4]";
            $this->validation->set_rules($rules);
            
            $fields['passwort1'] = 'Passwort';
            $fields['passwort2'] = 'Passwort (Wiederholung)';
            $this->validation->set_fields($fields);
        
            if ($this->validation->run() != false) {
    
                $insert = array(
                    'passwort' => $this->submit->post('passwort1')
                );
            
                $this->db->where('id', $this->session->userdata('id'));
                $this->db->update('benutzer', $insert);
            
                $data['hinweis'] = 'Das Passwort wurde geändert!';
            
            }
        
        }
        
        
        $data['benutzer'] = $this->global_model->benutzer_info($this->session->userdata('id'));
        
        $this->load->view('global/head');
        $this->load->view('global/kopf');
        $this->load->view('global/navigation');
        $this->load->view('benutzer/passwort', $data);
        $this->load->view('global/fuss');
    }

The error line is the following:
Quote:'passwort' => $this->submit->post('passwort1')

I've got no idea what is wrong on these lines. I already tested it and it worked. Now there's this error. Any advice?
#2

[eluser]swissbastian[/eluser]
Sorry, sorry, sorry… I found the mistake. My server was set to PHP version 4 instead of 5. Aaaaahh…




Theme © iAndrew 2016 - Forum software by © MyBB