-2

1image 2image 3image 4image

$email has data; not empty but
!empty($email) << false
and !empty('$email') << true
But I have some problems

Parse error syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING or T_VARIABLE or '$' in

chris85
  • 23,846
  • 7
  • 34
  • 51
심지훈
  • 1
  • 1
  • 2

1 Answers1

1

You must be using a version of PHP before 5.5. Per the manual:

Prior to PHP 5.5, empty() only supports variables; anything else will result in a parse error.

-http://php.net/manual/en/function.empty.php

The reason you are getting this is because anything single quotes is a string. Change it to:

if(!empty($email) and !empty($password))

and you should be good to go.

The issue and error message can be seen here, https://3v4l.org/EgfFb. I'd also recommend updating your PHP version because based on the error you are using <= 5.2.17.

chris85
  • 23,846
  • 7
  • 34
  • 51