Welcome Guest, Not a member yet? Register   Sign In
fatal error.
#1

[eluser]Ram Krishna[/eluser]
i have the controller code
Code:
<?php
class Client extends CI_Controller {
       function login()
        {
           $this->load->library('form_validation');
           IF($this->input->post('submit'))
             {
              $this->load->library('form_validation');
              $this->form_validation->set_rules('user_name','User Name','required');
              $this->form_validation->set_rules('password','Password','required');
              $this->form_validation->set_rules('user_type','User Type','required');
              IF($this->form_validation->run()=FALSE)
                {
                   $this->load->view('client_login_form');
                }
              else
                {
              $this->load->model('login_model');
              $row=$this->login_model->login();
              IF($row==1)
                 {
                     echo "You have been successfully logged in"
                 }
              else
                 {
                     echo 'wrong username or passwrod";
                     $this->load->view('client_login_form');
                 }
               }
             }
           else
             {
           $this->load->view('client_login_form');
             }
          
        }
}
?>
It is giving error-
Fatal error: Can't use method return value in write context in /opt/lampp/htdocs/crm/application/controllers/client.php on line 12.
i am unable to understand mistake.
#2

[eluser]Nisha S.[/eluser]
Make = to == at the specified line.
Code:
IF($this->form_validation->run()==FALSE)
#3

[eluser]LuckyFella73[/eluser]
And correct this line too:
Code:
echo 'wrong username or passwrod";

// change to
echo 'wrong username or password';
#4

[eluser]Ram Krishna[/eluser]
thanks it worked .....
#5

[eluser]Ram Krishna[/eluser]
Thanks it worked.




Theme © iAndrew 2016 - Forum software by © MyBB