Header problem

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Mon Nov 25, 2002 2:32 am

do you remember what i told you last time ?
I told you - "read documentation"...

New php-forum User
New php-forum User
Posts: 18
Joined: Fri Sep 27, 2002 6:35 am

Tue Nov 26, 2002 9:06 am

cooldownguy86 wrote:Hello, all php pro.
I did this

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php $id=$_GET['id'];
switch ($id)
{case 'home': header("Location: home.php"); break;
case 'story': header("Location: story.php"); break;} ?>

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


you cannot output headers (they are really HEADERS!!!!) after you output ANYTHING in output stream (like echoing, putting html code etc).
With best regards,
Cyril Kobets

Post Reply