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?
– Guilherme Golfetto
I use a Vagrant box called Scotch Box
– Giovanni Cruz
Managed to adjust?
– Sr. André Baill
But then you have to call the index method and not call the class, in the url
– Sr. André Baill