Php problem with a lesson


#1

hi, i'am stuck there: https://www.codecademy.com/fr/courses/web-beginner-fr-FR-gkc3z/0/6?curriculum_id=53710371fed2a8c7e9000001#

My code doesn't looks like having any problem :confused: , i'am stuck there for hours, the auto correct say there is a " ; " but can't see/understand where i should put one more


<!DOCTYPE html>
<html>
    <head>
		<title>Une boucle do-while</title>
	</head>
	<body>
    <?php
		$condition = false;
		do {
	echo "<p>La boucle est exécutée une fois alors que la condition est fausse.</p>";
		} while ($condition);
	echo "<p>Maintenant on est sorti de la boucle.</p>";
    ?>
    </body>
</html>


#2

Try this inside your loop:

echo "<p>La boucle est exécutée; une fois alors que la condition est fausse.</p>";

Notice the semi-colon in the sentence? Not sure this is the real fix but it worked for me.


#3

Well, it worked, thanks.

But that doesn't make sens right ? :confused:


#4

No it doesn't. The SCT is not a exhaustive test and may exhibit some anomalous behavior from time to time. I'm not well enough versed to investigate any further into this one.

While you are working on loops, I would recommend that you disable the auto-refresh before starting each lesson. That way you can take your time typing in the code.

<?php else ?>

at the top of your code (anywhere, actually) will raise a parse error and shutdown execution. Another option is to decrease the window size until the preview window disappears, which will do effectively the same thing, shut down the auto-refresh. Remember to remove that bit of code when ready to submit.


#5

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