Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Header Error

Status
Not open for further replies.

Meekos

Technical User
Feb 6, 2004
39
0
0
US
I am receiving this error when I try to redirect to another page in my web site.

Cannot modify header information - headers already sent by

I've identify that the problem is with this code.
if (!isset($_SESSION['admin']) || $_SESSION['admin'] != true) {
header ("Location: ['HTTP_HOST']."/login.php?category=a");
exit;
}

Can anyone tell me if I am missing something here?
 
Somewhere, you are creating HTML output. Either by having text (even whitespace) outside of your <?php ?> or inside it with a print or echo.
 
This question has been asked numerous amounts of times.
faq434-2999

*cLFlaVA
----------------------------
[tt]Sigs cause cancer.[/tt]
 
Thanks for the advice. I had an echo at the very top of my code. I did a search for header errors before posting. None of them worked.

Thanks for this link it was very informative.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top