I am practicing with a generic script from a book that I am reading. I keep getting an error message when I try to open the page in a browser.
<?php
if (empty ($userName)) {
print <<<HERE
<form>
Please enter your name:
<input type="text" name="userName"><br>
<input type="submit">
HERE;
} else {
print "Hi there, $userName!";
}
?>
I thought this would be about as simple as I could get, but I keep getting this error:
Parse error: parse error, unexpected $ in /usr/local/.../userName.php on line 30
Line 30 is after the </html> tag. I've matched all my brackets and used <?php instead of <?.
Could someone send me in the right direction here?
Thanks