Welcome Guest, Not a member yet? Register   Sign In
new with codeigniter
#1

[eluser]kiga[/eluser]
hi, i'm new with codeigniter, recently i installed it on a wamo server, when i try to run a controller i found shows this


( ! ) Fatal error: Call to undefined method CI_Controller::CI_Controller() in C:\wamp\www\CodeIgniter\application\controllers\formulario.php on line 11
Call Stack
# Time Memory Function Location
1 0.0007 385880 {main}( ) ..\index.php:0
2 0.0022 454368 require_once( 'C:\wamp\www\CodeIgniter\system\core\CodeIgniter.php' ) ..\index.php:201
3 0.0670 1350176 Formulario->__construct( )

the code i try is
Code:
<?php

/**
*
*/
class Formulario extends CI_Controller
{
    
    function __construct()
    {
        parent::CI_Controller();
        $this->load->helper(array('url', 'form'));
        $this->load->library('form_validation');
    }
    
    function index(){
        $this->form_validation->set_rules('nombre', 'nombre', 'required|trim|min_length[5]');
        $this->form_validation->set_rules('email', 'correo electrónico', 'required|valid_email|trim');
        $this->form_validation->set_rules('password', 'contraseña', 'required|trim|md5');
        $this->form_validation->set_rules('repassword', 'reescribir contraseña', 'required|matches[password]|trim|md5');
        
        $this->form_validation->set_message('required', 'Debe introducir el campo %s');
        $this->form_validation->set_message('min_length', 'El campo %s debe ser de al menos %s carácteres');
        $this->form_validation->set_message('valid_email', 'Debe escribir una dirección de email correcta');
        $this->form_validation->set_message('matches', 'Los campos %s y %s no coinciden');
        
        if($this->form_validation->run()==FALSE){
            $this->load->view('form_view');    
        }else{
            $data['nombre'] = $this->input->post('nombre');
            $data['password'] = $this->input->post('password');
            $this->load->view('exito_view', $data);
            
        }
        
    }
}

?>

and the url i use is http://127.0.0.1/CodeIgniter/index.php/formulario

how can i fix this?


Messages In This Thread
new with codeigniter - by El Forum - 04-13-2011, 01:44 PM
new with codeigniter - by El Forum - 04-13-2011, 02:02 PM
new with codeigniter - by El Forum - 04-13-2011, 04:57 PM
new with codeigniter - by El Forum - 04-14-2011, 08:47 AM
new with codeigniter - by El Forum - 04-14-2011, 11:07 AM
new with codeigniter - by El Forum - 04-14-2011, 02:11 PM
new with codeigniter - by El Forum - 04-14-2011, 03:39 PM
new with codeigniter - by El Forum - 04-14-2011, 03:43 PM
new with codeigniter - by El Forum - 04-14-2011, 04:02 PM
new with codeigniter - by El Forum - 04-14-2011, 04:07 PM
new with codeigniter - by El Forum - 04-14-2011, 04:14 PM
new with codeigniter - by El Forum - 04-14-2011, 04:17 PM
new with codeigniter - by El Forum - 04-14-2011, 04:29 PM
new with codeigniter - by El Forum - 04-14-2011, 04:43 PM
new with codeigniter - by El Forum - 04-14-2011, 04:55 PM
new with codeigniter - by El Forum - 04-14-2011, 06:43 PM
new with codeigniter - by El Forum - 04-14-2011, 08:52 PM
new with codeigniter - by El Forum - 04-15-2011, 12:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB