Jump to content

Recommended Posts

Hi I am new to codeigniter. I am making a login system. I just finished login form but when i hit login button then it displays this error

The requested URL /ci_login/user/login was not found on this server.

 

here is my code so far

user.php file which is in controller forlder

 

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

class User extends CI_Controller {
    function __construct() {
        parent::__construct();
    }
    
    function index() {

    }
    
    function login() {
        
        if($this->form_validation->run() == FALSE) {
            $this->load->view('view_login');
        } else {
            echo "Successfull";
        }
    }
}  

 

view_login.php file which is in view folder

<html>
<head>
<title>Login</title>
</head>
<body>
<h1>Please Login!</h1>

<p>Use the login form below to login.</p>
<div id="login_form">
    <?php echo form_open(base_url(). 'user/login' ) ?>
    <label>Username:</label>
    <div>
        <?php echo form_input(array('id' => 'username', 'name' => 'username')); ?>
    </div>
    <label>Password:</label>
    <div>
        <?php echo form_password(array('id' => 'password', 'name' => 'password')); ?>
    </div>
    <div>
        <?php echo form_submit(array('name' => 'submit'),'Login'); ?>
    </div>
    <?php echo form_close(); ?>
</div>
</body>
</html>  

help please how can I solve this error?

Link to comment
https://forums.phpfreaks.com/topic/237535-need-help-in-codeigniter/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.