Error 404 with Codeigniter

Asked

Viewed 367 times

1

I’m having the following mistake with Codeigniter: URL:http://192.168.33.10/crudex/index.php/user_controller

"404 Page Not Found, The page requested was not found."

Controller Code:

<?php  
if(!defined('BASEPATH')) exit ('No direct script access allowed');

class User_controller extends CI_Controller {

    // Controlador Padrão
    public function index() {
        $this->load->view('control_panel');
    }

    // Controlador de adição
    function add() {
        $this->load->view('add_panel');
    }

    // Controlador de edição
    function edit() {
        $result = $this->uri->segment(3);
        if ($result == NULL) {
            redirect('user_controller');
        }

        $pointer = $this->user_model->edit($result);
        $data['user_name'] = $pointer->user_name;
        $data['user_email'] = $pointer->user_email;
        $data['id_user'] = $pointer;

        $this->load->view('edit_panel', $data);
    }

    function delete() {
        $pointer = $this->uri->segment(3);
        $this->user_model->delete($pointer);
        redirect('user_controller');
    }

    // Controlador de 'save'
    function save() {
        if($this->('mit')) {
            $this->user_model->add();
            redirect('user_controller');
        } else {
            redirect('user_controller');
        }
    }

    // Controlador de atualização
    function update() {
        if($this->input->post('mit')) {
            $id = $this->input->post('user_id');
            this->user_model->update($id);
            redirect('user_controller');
        } else {
                redirec('user_controller');
        }
    }

}
?>
  • This your URL is from your local IP, we will not be able to access from outside your network, you climbed this code on some server?

  • I use a Vagrant box called Scotch Box

  • Managed to adjust?

  • But then you have to call the index method and not call the class, in the url

1 answer

0

That your url is wrong, what would crudex be? I think your correct url would be:

http://192.168.33.10/index.php/user_controller
  • Didn’t work...

  • Can it be your htacess or conf. d tas using apache or Nginx? How is your folder structure?

  • It is apache, it was working normal until yesterday... Folder organization link: https://www.flickr.com/photos/143995297@N06/shares/1b92G4

Browser other questions tagged

You are not signed in. Login or sign up in order to post.