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

For Loops in PHP Forum

View Course

297 points
95fe7de5943b7293196178b883a17951?s=140&d=retro
Submitted by
B 913770590
over 1 year ago

Infinite loops broke the tutorials.

I'm doing the PHP tutorials, and some loops I used caused the "For loops in PHP" and "While loops in PHP" sections to hang whenever I try to load them.

This is the for loop that crashed:
for ($i = 1; $i <= 10; i++)
{
echo $i * 10;
}
I guess that crashed because I did "i++" rather than "$i++". Oops.

This is the while loop:
while (true)
{
break;
}
I thought this would work in PHP, maybe not.

When I open either tutorial, the pages appear normally, but there is a spinning progress bar blocking me from modifying my code. I am also unable to click any useful buttons like reset code or change lesson. Any way to reset a tutorial from my account?


0 votes

permalink

I was actually able to edit the text, and it shows correctly in the display window, but the loading icon is still blocking the screen, and I can't hit submit.

297 points
95fe7de5943b7293196178b883a17951?s=140&d=retro
Submitted by
B 913770590
over 1 year ago

1 Comment

Fee73f80f23b2c68adf94d2d0fc257fe?s=140&d=retro B over 1 year ago

We spend more time trying to make Code Academy work than learning PHP.


0 votes

permalink

Do this:

  1. Log out of codeacademy
  2. Clear your browser's cache and cookies
  3. Log back in to codeacademy

The code window should now be reset to default for that exercise.

**To prevent this from happening, I'd recommend typing loop code in another text editor outside codeacademy and then pasting it in. I guess the PHP lessons use the same editor / compiler as the HTML ones, but that makes it so that it is constantly trying to compile what you are typing, which means you end up with it trying to run a partially coded loop that breaks the thing.

1274 points
55ef9f05e39efe003c00002f_741702465
Submitted by
AeonGrey
over 1 year ago

1 Comment

Fee73f80f23b2c68adf94d2d0fc257fe?s=140&d=retro B over 1 year ago

Maybe you can change the PHP editor/ compiler so this does not happen. I logged out and back in but did not clear cache, never had to do that on a MAC before. Please fix the tutorial.


0 votes

permalink

That did it, thank you! :D

297 points
95fe7de5943b7293196178b883a17951?s=140&d=retro
Submitted by
B 913770590
over 1 year ago