<?php $this->load->library('form_validation'); ?> <?php echo validation_errors(); ?> <?php echo form_open('cpages/ceklogin'); ?> <div class="login-card"> <center><?php //echo $warning; ?> <?php echo $this->session->flashdata('warning'); ?> </center> <h2>Gionda CMS Login</h2><br> <form> <div class="login"><input type="text" name="username" placeholder="Username"></div> <div class="login"><input type="password" name="password" placeholder="Password"></div> <br> <input type="submit" name="login" class="login login-submit" value="login"> </form> <div class="login-help"> <a href="#">Register</a> • <a href="#">Forgot Password</a> </div> </div>


public function ceklogin() {

        $username = $this->input->post('username', TRUE);
        $password = $this->input->post('password', TRUE);
        $this->db->where('username', $username);
        $this->db->where('password', $password);
        if ($query->num_rows() >= 1)
                // echo 'LOGIN BERHASIL !';

                $this->load->view('index', $data);
                // echo 'LOGIN GAGAL !';

                $this->session->set_flashdata('warning', 'Your username and password are wrong !');

                //$data['warning']='Your username and password are wrong !';



    public function login()
        $query = $this->db->get('login');
        return $query->result();

username email password role
user 12345 administrator
user2 $2y$10$PrDTzzETQ.NzI9eIN0WYDubhBZhkg9XEo10MxRYpv4M manager

I have tried to login with username: user password: 12345 and have not been successful to login yet. I wonder why?


Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

I've noticed that you link to urls at localhost a lor you realize thr link doesnt work for anyone other than you, right?

I am assuming you are using Codeigniter ..

  1. Check your route.php file for correct route entry.
  2. Check if your local server is running properly. (Like WAMP)

I think it's a routing problem.

Please reply with your route.php code. If you are using Codeigniter.

I wonder how to route it:


$route['default_controller'] = 'cpages/login';

$route['cpages/login'] = 'cpages/login';

Can anyone help me find out? Why Object not found appears?

What does your config.php file look like?

| Base Site URL
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
| WARNING: You MUST set this value!
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
$config['base_url'] = 'http://localhost/masterlinkci2/admin/';

| Index File
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
$config['index_page'] = 'index.php';