I think I am going a bit nuts. I am following along with Kevin Yanks book on Build Your Own Database Driven Websites.
I have tried programming the examples myself as well as uploading the code archive to my localserver.
But I get the same warning with the following script
The warning that I get is
include_once $_SERVER['DOCUMENT_ROOT'] .
$pagetitle = 'New Author';
$action = 'addform';
$name = '';
$email = '';
$id = '';
$button = 'Add author';
include $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
$name = mysqli_real_escape_string($link, $_POST['name']);
$email = mysqli_real_escape_string($link, $_POST['email']);
$sql = "INSERT INTO author SET
if (!mysqli_query($link, $sql))
$error = 'Error adding submitted author.';
Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/php/chapter4G/authors/index.php:1) in /Applications/XAMPP/xamppfiles/htdocs/php/chapter4G/authors/index.php on line 27
The code that I have pasted at the top of the page is the line 1 in my PHP file.
The header('Location: .'); is not in any other code.
Can someone help please.