PHP Parsing error that works on localhost?


#1

I seem to not be able to do exercise 1 of Control Flow: Switch.

When I run the code on my local PHP server, it gives me the correct response, You're one, but when I run it through Codecademy, it says Parse error: syntax error, unexpected ';' on line 12.

<!DOCTYPE html>
<html>
    <head>
		<title></title>
	</head>
	<body>
    <?php
    $myAge = 1;
    
    if($myAge == 1) {
        echo "You're one";
    }
    
    elseif($myAge == 2) {
        echo "You're two";
    }
    
    else {
        echo "You're a wizard, Harry!";
    }
    ?>
    </body>
</html>

Anyone helping me?


#2

Did you try after refreshing your browser?


#3

I did, but it still isn't parsing :confused:


#4

can you please post a full screenshot?

also include the lesson link please


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.