0

Hi,

Assume I start session and print data stored in session and print some html stuff at the begining of php file. Then I need to use header() to download a file afterwards.

When I do it i get this error:

Warning: Cannot modify header information - headers already sent by (output started at /var/www.....

I know I have to use ob_start() and flush but cannot apply it. I don't want to cache everything from begining untill end in my page because it is too long.

Would you please anyone show me an example?

thanks in advance

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by veledrom
0

you can use the javascript window.location instead...
<?php echo "<script>window.location='yourpagehere.php'</script>"; ?>

0

I removed all the HTML codes between ob_start and flush. I echo-ed them. It works now.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.