title: A PHP Error was encountered severity:8192 I'm getting the error
body: <p>Methods with the same name as their class will not be constructors in a future verisons of PHP, login has a deprecated constructor severity:8192 </p>
  
  <p>I get an error in line 3rd and 26th line in the login php file
  26th line error: undefined property:login::$load 
  I'm getting the error</p>
  
  <p><strong>MY CODE</strong></p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  </code></pre>
  
  <p>class login extends CI_Controller {</p>
  
  <pre><code>/**
   * Index Page for this controller.
   *
   * Maps to the following URL
   *      http://example.com/index.php/welcome
   *  - or -
   *      http://example.com/index.php/welcome/index
   *  - or -
   * Since this controller is set as the default controller in
   * config/routes.php, it's displayed at http://example.com/
   *
   * So any other public methods not prefixed with an underscore will
   * map to /index.php/welcome/&lt;method_name&gt;
   * @see http://codeigniter.com/user_guide/general/urls.html
   */
  public function index()
  {
      $this-&gt;load-&gt;view('login');
  }
  function login(){
      $data ["title"] = "CodeIgniter Simple Login Form with session";
      $this-&gt;load-&gt;view("login", data);
  
  }
  function login_validation(){
      $this-&gt;load-&gt;library('form_validation');
      $this-&gt;form_validation-&gt;set_rules('username', 'Kullanýcý Adý', 'required');
      $this-&gt;form_validation-&gt;set_rules('password', 'password', 'required');
      if($this-&gt;form_validation-&gt;run())
      {
          $username = $this-&gt;input-&gt;post('username');
          $password = $this-&gt;input-&gt;post('password');
          $this-&gt;load-&gt;model('login_model');
          if($this-&gt;login_model-&gt;can_login($username, $password))
          {
  
              $session_data = array(
  
                  'username'  =&gt; $username
  
              );
              $this-&gt;session-&gt;set_userdata($session_data);
              redirect(base_url("login/enter"));
  
          }else{
              $this-&gt;session-&gt;flash_data('error' , 'Invalid Username and Password');
              redirect(base_url("login"));
  
          }
      }else
          {
              $this-&gt;login();
      }
      function enter()
      {
          if($this-&gt;session-&gt;userdata('username') != ''){
              redirect(base_url("dashboard"));
  
          }else{
                  redirect(base_url("login"));
          }
  
      }
  
  
  }
  </code></pre>
  
  <p>}
  ?></p>