Header problem

cooldownguy86 said:
Hello, all php pro.
I did this
Code:
<html>
<head>
<title>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php $id=$_GET['id'];
switch ($id) 
{case 'home': header("Location: home.php"); break;
case 'story': header("Location: story.php"); break;} ?>
</body>
</html>

and this came out when goto.php?id=story:
Warning: Cannot add header information - headers already sent by (output started at D:\Inetpub\wwwroot\php\gb\goto.php:9) in D:\Inetpub\wwwroot\php\gb\goto.php on line 12

why?

you cannot output headers (they are really HEADERS!!!!) after you output ANYTHING in output stream (like echoing, putting html code etc).
 
Back
Top