Infinite loop


#1

I think i created an infinite loop. Index.php was saved, so i can`t reset code because when I open this lesson it says "Something went wrong :frowning:
Click Close to try again or refresh the page.". What should I do?


Reset execise with loop
#2

What might work (it has before in jQuery track) is to go the to lesson previous and zoom the screen until the preview window disappears (as high a 400%). This should let you get to the next lesson and Reset the code. Then zoom back down to 100%

Because of auto-run, an incomplete loop statement may execute and make the page unusable. Before constructing a loop, introduce a simple syntax error in your code.

<?php
    else
?>

This is will disable the auto-run. When your while statement is complete (control variable initialized outside the loop (before) and incremented inside the loop) then remove the syntax error and your code will run.


#3

Thanks mtf! It seems that a few other people have the same 'something went wrong' error message, so I posted a paraphrased version of your solution on those Q&A threads.

@krytek4321 I had the same problem and mtf's solution worked for me (and I realized my code had a few errors, which I fixed).

Update: It seems every few pages I get this error message and the solution was only temporary.


#4

is their still a problem going on with php because it is not working for me


#5

thanks a lot it worked