Multiline Echo Not Closing Off?

Toodles, y’all! o/ So this time I have code that should technically work, but doesn’t, practically. It’s a simple multiline echo to print some HTML into the browser, and for the most part, it works.

[php]<?php //formtest2.php
if (isset($_POST[‘name’]))
$name = $_POST[‘name’];
else
$name = “(Not entered)”;
echo <<<END

Form Test Your name is: $name
What is your name? END; ?>[/php]

It works perfectly, until you get to the last two lines. Apparently, it gets very comfortable being an echo, and doesn’t want to leave, because END isn’t called properly at all. Instead, the page draws up the HTML correctly, but deposits a neat

END; ?>
below the input box as though it were part of the echo. Same thing happens when using apostrophes instead of <<<ECHO.

Any help is much appreciated. [:)]

UPDATE: Okay, this is even weirder: The code doesn’t work on my PC, but works on my mac. Same browser, same compiler, exact same code. Thoughts? [:S] [:P]

You have a space before END.

From the Manual:

Warning It is very important to note that the line with the closing identifier must contain no other characters, except a semicolon. That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon.
Sponsor our Newsletter | Privacy Policy | Terms of Service