Chenyue Hu
Chenyue Hu

Reputation: 29

form_open() method not working that no form has been shown

This is my view/login/loginform.php

<?php echo form_open('scheduler/login');
?>
    <label for="username">username</label>
    <input type="text" name="username"/><br/>

    <label for="password">password</label>
    <input type="password" name="password"></input><br/>

    <input type="submit" name="submit" value="log in" />
</form>

This is my controllers/Scheduler.php

<?php


class Scheduler extends CI_Controller {
    public function login()
    {
        $this->load->helper('form');



            echo"not logged in";
            $username=$this->input->post("username");
            $password=$this->input->post("password");

            if($username=="123" && $password="abc"){
                $data['username']=$username;
                $this->load->view('login/login_success_message',$data);
                //$this->input->set_cookie('123','abc','15');
               // redirect('home');

            }
            else {
                $this->load->view('login/login_failure_message');
                //$this->load->view('login/loginform');
            } 
    }
}

?>

However, there is no form shown when I go the http://localhost/project/scheduler/login

Upvotes: 0

Views: 42

Answers (2)

Jagdeep Singh
Jagdeep Singh

Reputation: 134

if the problem is still same then try to call $this->load->view('login/loginform');out side if else statement

Upvotes: 0

Dum
Dum

Reputation: 1501

//$this->load->view('login/loginform');

You are not loading the login form. So, Uncomment the above line

$this->load->view('login/loginform');

Upvotes: 1

Related Questions