Page 1 of 1
problem with header()
Posted: Mon Aug 01, 2005 2:27 pm
by itsmani1
see this code....
Code: Select all
echo "I am here...";
header("Location:index.php?log=true");
exit;
it gives me an error something like "Header already sent.."
i want to use echo "I am here ...." before header();
can i do so?
Thanx.
Re: problem with header()
Posted: Mon Aug 01, 2005 2:30 pm
by anjanesh
itsmani1 wrote:
i want to use echo "I am here ...." before header();
can i do so?
I guess its impossible.
Re: problem with header()
Posted: Mon Aug 01, 2005 2:34 pm
by Roja
itsmani1 wrote:
i want to use echo "I am here ...." before header();
can i do so?
Yes. Use output buffering.
http://us3.php.net/manual/en/function.ob-start.php
Posted: Mon Aug 01, 2005 2:35 pm
by timvw
If this is for testing, you can also write the "i'm here" into a file..
Or if you use a debugger, you should be able to step untill before the header call..