Whats wrong with my code?


#1



https://www.codecademy.com/courses/web-beginner-en-jZv2E/0/1?curriculum_id=5124ef4c78d510dd89003eb8#


Im getting this error message but im not sure why:
Parse error: syntax error, unexpected ';', expecting T_VARIABLE or '$' on line 10


<!DOCTYPE html>
<html>
    <head>
		<title></title>
	</head>
	<body>
    <?php
    $name = "Jake"
    if ($name = Jake) {
        echo "Hello Jake";
    } elseif ($name = John) {
        echo "You're not Jake";
    } else {
        echo "Where's Jake?";
    }
    ?>
    </body>
</html>

I cant see any mistakes, any ideas?


#2

No semicolon here. :slight_smile:

Also, I believe comparison is done via == not just =.


#3

Thanks for your reply :slight_smile:

Ive changed it to

<?php
$name = "Jake";
if ($name == Jake) {
echo "Hello Jake";

Now I have a new message saying:

Use of undefined constant Jake - assumed 'Jake' (line 9)Hello Jake


#4

I should've seen that earlier,

You need to compare $name to "Jake" and "John", because they are strings not variables. :slight_smile:


#5

@cades no they are varriables being declared


#6

You are comparing a variable to two strings.

No they aren't both variables.


#7

:slight_smile:@cades explain that to me


#8

$variableHasADollarSign

"String enclosed in quotes"