On page 203 of Kevin Yank;s book is:
<?php include_once $_Server['Document_Root'] . '/includes/helpers.inc.php'; ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Manage Authors</title>
</head>
<body>
<h1>Manage Authors</h1>
<p><a href="?add">Add new author</a></p>
<ul>
<?php foreach ($authors as $author); ?>
<li>
<form action="" method="post">
<div>
<?php htmlout($author['name']); ?>
<input type="hidden" name="id" value="<?php echo $author['id']; ?>" />
<input type="submit" name="action" value="Edit" />
<input type="submit" name="action" value="Delete" />
</div>
</form>
</li>
<?php endforeach; ?>
</ul>
<p><a href="..">Return to JMS home</a></p>
</body>
</html>
When executed I get:
Notice: Use of undefined constant authors - assumed âauthorsâ in C:\xampp\htdocs\Jokes\Admin\Authors\index.php on line 15
Notice: Use of undefined constant html - assumed âhtmlâ in C:\xampp\htdocs\Jokes\Admin\Authors\index.php on line 15
Notice: Use of undefined constant php - assumed âphpâ in C:\xampp\htdocs\Jokes\Admin\Authors\index.php on line 15
Warning: include(authorshtmlphp): failed to open stream: No such file or directory in C:\xampp\htdocs\Jokes\Admin\Authors\index.php on line 15
Warning: include(): Failed opening âauthorshtmlphpâ for inclusion (include_path=âC:\xampp\htdocs\includesâ) in C:\xampp\htdocs\Jokes\Admin\Authors\index.php on line 15
Netbeans also tells me that the âendforeachâ is unexpected?