Welcome Guest, Not a member yet? Register   Sign In
class not found in loader.php
#1

[eluser]rijobo[/eluser]
Hello,

I get an error when I want to open my form:

Fatal error: Class 'Productupload' not found in /usr/home/deb20206/domains/bijvoorbeeldzo.nl/public_html/simo-edelsmid/system/libraries/Loader.php on line 184

Can anyone please help me out with this one?

This is my controller:

Code:
<?php

class Administrator extends MY_Controller {

function Administrator()
    {
        parent::MY_Controller();
        if(!$this->auth->is_logged_in())
        {
             $this->error_redirect('U bent niet ingelogd', 'inloggen');
        }
        $this->load->model('Productupload');
     }


function index()
    {
        $this->load->view('product_toevoegen');
    }

function upload()
    {
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'png|gif|jpg';
        $config['max_size']  = '10000';
        $upload_veld = 'foto';
        
        $this->load->library('upload', $config);
        
        if($this->upload->do_upload($upload_veld)) {
            $data['upload_data'] = $this->upload->data();
        } else {
            $data['error'] = $this->upload->display_errors();
        }
        
        $product = array('naam'=>$_POST['naam']);
        
        $this->Productupload->insertRow('product', $product);
        
        $this->load->view('product_toevoegen_resultaat', $data);
    }    

}

and this is my model:

Code:
class Productupload extends Model{

function Productupload(){
    parent::Model();
    $this->load->database();
}

function insertRow($table, $data){
    $this->db->insert($table, $data);
}

}
#2

[eluser]pistolPete[/eluser]
Is the file Productupload.php in ./application/models/ ?
Try a lowercase or uppercase p.
#3

[eluser]rijobo[/eluser]
Uppercase I get this message:

Unable to locate the model you have specified: productupload

And lowercase I get this:

class Productupload extends Model{ function Productupload(){ parent::Model(); $this->load->database(); } function insertRow($table, $data){ $this->db->insert($table, $data); } }
Fatal error: Class 'Productupload' not found in /usr/home/deb20206/domains/bijvoorbeeldzo.nl/public_html/simo-edelsmid/system/libraries/Loader.php on line 184
#4

[eluser]pistolPete[/eluser]
Does the file Productupload.php start with a PHP opening tag?
Code:
<?php
#5

[eluser]rijobo[/eluser]
that's it!
Thank you very much




Theme © iAndrew 2016 - Forum software by © MyBB