Remember that you can only use a header() function prior to anything going to the output stream. When you start printing your regular HTML code tags such as <HTML> or <BODY> you are putting those in the output stream. Even outputting any spaces or echoing content prior to header() is considered sending output to the client and thus HTML headers will have been sent.
To make a long story short, you can't display or show anything prior to using a header() call. This is why you typically find header() calls in scripts that handle info before rendering any of the HTML page or echoing any info.
As soon as you did this....
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
You sent your headers thus header() is no longer available.
Hope that helps.
This post has been edited by Martyr2: 13 Mar, 2008 - 11:07 AM