Page 1 of 1
Redirection: header("Location: ") doesnot work in
Posted: Wed Jan 04, 2006 3:06 am
by bikram99
In localhost I'm using EasyPHP1.7. To redirect the browser following code:
does work. But when I deploy the same code over remote site following error is generated.
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/webhome/nwpweb/haatbazar/haatbazar/controlcenter/index.php:2) in /var/www/html/webhome/nwpweb/haatbazar/haatbazar/controlcenter/index.php on line 25
Please help me out.
Bikram
Posted: Wed Jan 04, 2006 3:57 am
by djot
-
This is a common error that occurs when using session, cookies or headers. The message states that output already started and therefor no header information could be send anymore. So what's wrong? You have some output in front of your header line.
Check your file to
1. have <?php in line 0, being the first signs (so no empty lines or spaces before)
2. not have things like <?php...?> <?php...?> (spaces or html output)
3. ?> being the last 2chars in your files, so no line break or space behind.
If you find nothing in the current file, also check files you perhaps included before.
djot
-
Posted: Wed Jan 04, 2006 8:00 am
by dude81
In simple words there should be no spaces and html code before header function
Cheers

Posted: Wed Jan 04, 2006 8:12 am
by feyd
viewtopic.php?t=1157
I've lost count and don't care to figure out what the last count was...

Posted: Wed Jan 04, 2006 9:45 pm
by bikram99
Everybody,
Thank you very much for replying and answering my query. I'll track my code according to the suggestions.
But now, my question is "Why does this still work while working in EasyPHP-7?"
Thank you Again
Bikram
Posted: Wed Jan 04, 2006 10:12 pm
by timvw
bikram99 wrote:
But now, my question is "Why does this still work while working in EasyPHP-7?"
I don't have a clue what EasyPHP-7 is, but i'm pretty sure the answer is the following: It buffers the output (you'll find more about this in the threads you find when you follow feyds link)