最近、phpの勉強をし始めたのですが、
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\test\cookie1.php:1) in C:\Program Files\xampp\htdocs\test\cookie1.php on line 1
とIE7ブラウザに表示され、正常に動作ができません。

書籍の通りに入力して実行したのですが、何が間違っているのかわかりません。
どうかよろしくお願いします。

以下が、cookie1.phpの内容です。
<?php setcookie('val', 100); ?>
<HTML><BODY>
<?php
$getval=$_cookie['val'];
print "ページ1の値は $getval です。<BR>";
?>
<A HREF='cookie2.php'>ページ2へ</A>
</BODY></HTML>