PHP loop error?


#1



https://www.codecademy.com/courses/web-beginner-en-5YvPF/0/7?curriculum_id=5124ef4c78d510dd89003eb8#


the page gets stuck. the preview keeps giving the circle load and when i press submit the button dissapear. i tried reloading several time but it keeps putting back this code even after i reset


        $roll = rand(1,6);
        while ($roll != 6) :

        echo $roll;
        endwhile;


#2

@cloudwhiz50603,

The Instructions:
Create a do/while loop below the comment
within the <?php ?> tags in the editor.
Then click Save & Submit Code to make sure it behaves the way you think it should.

You are uing the while()-endwhile loop

You are giving the variable $roll a rondomized Value between 1 and 6

Then if the $roll variable does not have the Value of 6
you will enter the while loop
AND you will NEVER leave this while loop !!!!!


#3

The code will be saved client side u can fix this by either deleting your cookies or launching firefox in private modus :slight_smile: for anyone having problems like this