PHP error, if-statement

What pinches this code?

if(isset($this->session->flashdata('login_error'))) {      // Line 39
     echo "You entered an incorrect email or password!";
}

I am using Codeigniter, and the session is loading in autoload.php.

The error message I get is:

Fatal error: you cannot use the return value of the method in the context of the entry in / Applications / XAMPP / xamppfiles / htdocs / application / views / login _view.php on line 39

+5
source share
4 answers

isset , , . , , , . , isset . if ($this->session->flashdata('login_error')), .

+12

, ($ this- > session- > flashdata ('login_error')) false, FALSE NULL

+1

isset. , - :

$txt = $this->session->flashdata('login_error');
if(!empty($txt))
{
     echo "You entered an incorrect email or password!";
}
+1

isset . , isset . :

if($this->session->flashdata('login_error') != null) {      // Line 39
     echo "You entered an incorrect email or password!";
}
+1

All Articles