1/6 Parse Error



This is for exercise 1/6: Glance at the Past. My code is being accepted when I submit it, but I can't get the desired results to print on screen. Here's my code and result, respectively:


<!DOCTYPE html>
    $name == "John"
    if ($name == "John") {
        echo "I know you";
    else if ($name == "Eric") {
        echo "I know you too";
    else {
        echo "Who are you?";


Parse error: syntax error, unexpected T_IF on line 11

Hope you can help me out!



You have to insert a semicolon at the end of this line

$name == "John"

like this

$name == "John";


Hi Rydan,

Thanks for that. I got a new error after that. Pasting my code and results here. Hope you can help me out again.



you wrote

$name == "John";//== is a comparison operator

should be

$name = "John";//= is the assignment  operator

I missed that the first ime


That fixed it. Thanks rydan!