-3

I need to check multiple varibles but I'm getting the following error:

Parse error: syntax error, unexpected '!' in /Applications/MAMP/htdocs/carematch3/includes/user.php on line 42

LINE 42

if(!empty($firstname) && !empty($lastname) && !empty($email) && !empty($phone) !empty($gender) && !empty($dob)) {
                $phaseOne = true;
            }
Brad Fletcher
  • 3,547
  • 3
  • 27
  • 42
  • 3
    There's an "and" operator missing `!empty($phone) !empty($gender)` – KhorneHoly Dec 16 '16 at 13:41
  • `!empty($phone) !empty($gender)` – Sayantan Das Dec 16 '16 at 13:42
  • oh wow, thanks... how i missed that i will never know! – Brad Fletcher Dec 16 '16 at 13:42
  • 1
    @BradFletcher If you have a long code line and there is an error in it you can always split the long code line over multiple lines and so the error message will tell you exactly on what line the error is and then you know better where the error is. Example: `if(!empty($firstname) &&` new line `!empty($lastname) &&` new lines ... – Rizier123 Dec 16 '16 at 13:47

1 Answers1

-1

Your code

if(!empty($firstname) && !empty($lastname) && !empty($email) && !empty($phone) !empty($gender) && !empty($dob)) {
            $phaseOne = true;
        }

My Code :

if(!empty($firstname) && !empty($lastname) && !empty($email) && !empty($phone) **&&** !empty($gender) && !empty($dob)) {
            $phaseOne = true;
        }

Please check the syntax error in bold correction

Rahul
  • 18,271
  • 7
  • 41
  • 60