This forum is now read-only. Please use our new forums at discuss.codecademy.com.

For Loops in PHP Forum

View Course

604 points
5769985514f3efa0ab0006b9_57482615
Submitted by
Jub
about 2 years ago

3/7 Cant load the loop till 100

every time i click the submit button it says

Something went wrong :(
Click Close to try again or refresh the page.

I dont think that my code is wrong. Here it is,

<html>
  <head>
    <title>Solo For Loop!</title>
  </head>
  <body>
    <p>
      <?php
      // Write your for loop below!
      for ($i = 10; $i < 100; $i + 10) {
       echo $i;   
      }
      ?>
    </p>
  </body>
</html>

Im using mozilla firefox


0 votes

permalink

I am having exact the same problem.

529 points
5390b4e3631fe95e39000016_700296818
Submitted by
Artiom Lootus
about 2 years ago

1 Comment

5390b4e3631fe95e39000016_700296818 Artiom Lootus about 2 years ago

It worked later on


0 votes

permalink

same problem

470 points
5292af8f80ff33a18e00043a_535213259
Submitted by
Kris D'Amato
about 2 years ago


0 votes

permalink

it's editor problem. if you write this code on another notepad and copy code from notepad and past the codecadamy ide then it's work.

354 points
541ae0867c82caf9790025b0_111814137
Submitted by
Inversemaha
about 2 years ago


0 votes

permalink

Have same issue. Notepad solution does not work for me.

510 points
Picture
Submitted by
Lurial
about 2 years ago


0 votes

permalink

Same here. I posted this somewhere else on the forum. Same issue in the conditions section as well so moved on. It worked fine and allowed me to do other sections but then did it again in the Loops section.

92 points
3285057f4e7a2fcfad10202e18f0a846?s=140&d=retro
Submitted by
simonwallacephillipsgmail.com
about 2 years ago


0 votes

permalink

same problem here, but to me, the page doesn't work at all

42 points
52447fa280ff33e481001560_76179867
Submitted by
Wallace Kutner
about 2 years ago

1 Comment

52447fa280ff33e481001560_76179867 Wallace Kutner about 2 years ago

edit: if the page is stuck with the rotating loading icon blocking the reset code button, use the browser's dev mode to delete this layer, worked for me


0 votes

permalink

"Write a for loop that counts up by 10, all the way to 100" In your condition you have $i<100, this means that 100 is never going to be reached. Try $i <= 100.

for ($i = 10; $i <= 100; $i = $i + 10) {
echo $i;
}

71 points
Picture
Submitted by
Guillermo Ontiveros Ancona
about 2 years ago