You just need to understand what the error is telling you - you can't modify headers if the page already has content. In your script, by the time you modify the header your page already has:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>The test page! </title>
<META NAME="keywords" CONTENT="test page, test, page">
<META NAME="description" CONTENT="Test page">
<META NAME="ROBOTS" CONTENT="ALL">
</head>
<body>
<div>
<table width="339" border="0" align="left">
<tr>
<td width="333">Visitors :
What you need to do is move your php code to the top of the page, so that if the header changes it happens before the page output starts...