Save and Submit Issue


#1


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

I don't get any errors, but when I press submit it just shows the gear animation for a few seconds then just stops. The editor also shows, "Parse error: syntax error, unexpected '}' on line 13".

<!DOCTYPE html>
<html>
    <head>
		<title>Your First PHP while loop!</title>
	</head>
	<body>
    <?php
	$loopCond = true;
	while ($loopCond = true){
		//Echo your message that the loop is running below
		echo "<p>The loop is running.</p>";
		$loopCond = false;
	}
	echo "<p>And now it's done.</p>";
    ?>
    </body>
</html>


#2

Here:

It should be ==. That's an expression I believe, and not a variable assignment.


#3

Okay, I'll test it out.


#4

Okay, please do and revert! :slight_smile:


#5

Just getting this now:

Oops, try again. expected p:first-child text to be equal to The loop is running. but got


#6

Wow! Please hope we are still on same exercise in this thread.

Okay, see full working code below:

<!DOCTYPE html>
<html>
    <head>
		<title>Your First PHP while loop!</title>
	</head>
	<body>
    <?php
	$loopCond = true;
	while ($loopCond == true){
		echo "<p>The loop is running.</p>";
		$loopCond = false;
	}
	echo "<p>And now it's done.</p>";
    ?>
    </body>
</html>

#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.