My code for all three files is exactly as written in the book, however, after submission, the form outputs the 'welcome.html.php' page even if nothing is entered in the 'firstname' box of the form.

Is the problem that $_REQUEST['firstname'] is considered to have been set even though it's value is nothing?

TIA

index.php
PHP Code:
<?php
if (!isset($_REQUEST['firstname']))
{
    include 
'form.html.php';
}
else
{
    
$firstname $_REQUEST['firstname'];
    
$lastname $_REQUEST['lastname'];
    if (
$firstname == 'Kevin' and $lastname == 'Yank')
    {
        
$output 'Welcome, oh glorious leader!';
    }
    else
    {
        
$output 'Welcome to our web site, ' .
            
htmlspecialchars($firstnameENT_QUOTES'utf-8') . ' ' .
            
htmlspecialchars($lastnameENT_QUOTES'utf-8') . '!';
    }
    
    include 
'welcome.html.php';
}
?>

form.html.php
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml1" xml:lang="en" lang="en">
	<head>
		<title>Form Example</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
    <form action="" method="post">
		<div><label for="firstname">First name:
			<input type="text" name="firstname" id="firstname" /></label>
		</div>
		<div><label for="lastname">Last name:
			<input type="text" name="lastname" id="lastname" /></label>
		</div>
		<div><input type="submit" value="GO" /></div>
	</form>
</body>
</html>

welcome.html.php
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml1" xml:lang="en" lang="en">
	<head>
		<title>Form Example</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
	<p>
		<?php echo $output; ?>
	</p>
</body>
</html>