'For' Loop Syntax - Lesson bugged


#1

After changing all the syntax, the lesson cannot be completed.
Is this due to bug in the lesson?

The code prints correctly, though.

Code as follows :

<html>
  <head>
    <title>For Loops</title>
  </head>
  <body>
    <p>
      <?php
        // Echoes the first five even numbers
        For ($i = 2; $i < 11; $i = $i + 2) {
          echo $i;
        }
      ?>
    </p>
  </body>
</html>

#2

PHP code should only be written in lower case...

    for ( ... )

#3

please show me error in for loop syntex
given code is show error



For Loops



<?php
// Echoes the first five even numbers
for ($i = 2; $i < 11; $i = $i + 2) {
echo $i;
}
?>




#4

Seems like it still did not get fixed.. tried 3 browsers now - and almost went crazy.

iam currently php - too bad it's bugged; it has been good till now :frowning:

It's trying to run my code while i type it and then of course gets stuck in the loop..

after that it ignores what ever code i throw at it - and it doesn't matter if i reload the page or remove the entire code..

still the same error :\

it should only check the code when submitting and then run the loop and not like it's doing it.


#5

Either change the window size or zoom so the preview window disappears. This should allow you to continue working on the code.

For lessons that include loops, we can disable the auto-refresh with a parse error in our code:

<?php else ?>

Remove when ready to submit and/or restore the preview window.


#10