Les boucles "While" in PHP Erreur in test 6


#1

Hello world

I encountered a problem on exercise 6 in php. I have repeatedly done this and codecademy still gives me the same error message "Oops, please try again. Did you add a semicolon after the text to display?"
Wanting to finish the php lesson I would like to be able to pass this stage which hinders me in my learning.

Thank you well in advance


#2

Could you please post the code that you have tried? :slight_smile:


#3

<!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>

#4

Hi there

I have the same problem on exercise 6, every time a different error message and then the browser just freezes. I changed browser and it froze again, as it happened also in previous exercises.
Here's my code:

	$loopCond = false;
		do {
			echo "<p>The loop ran even though the loop condition is false.</p>";
		} while ($loopCond = true);
		echo "<p>Now the loop is done running.</p>";

Thank you!


#5

Could I see your full (HTML + PHP) code?


#6




Une boucle do-while


<?php
$condition = false;
do{
echo "

La boucle est exécutée une fois alors que la condition est fausse.

";
}while ($condition);
echo "

Maintenant on est sorti de la boucle.

";
?>


#7

impossible d'avancer après Les boucles "While" en PHP au niveau de l'exercice 6 demandant de compléter la boucle. SVP aidez moi à passer cette étape; sachant que j'ai fait ce qu'on demande comme travail.