Click to See Complete Forum and Search --> : PHP and jpcache
raven80
07-12-2005, 01:41 AM
I use jpcache with my page but it caches my page once. When timeout it doesnt cache again, and when I delete all cached file, it caches again.
and it appear this message:
Warning: Cannot modify header information - headers already sent by (output started at C:\Website\jpcache\index.php:4) in C:\Website\jpcache\jpcache-main.php on line 172
How to fix it? Thank you
SpectreReturns
07-12-2005, 02:46 AM
Use the ob functions, to make it send all content at the very end of the script, that way headers may be sent at any time previous to that.
raven80
07-12-2005, 03:27 AM
thanks, but can you show me clearly :) i'm newbie, I dont know how to use ob function. Thank again :)
SpectreReturns
07-12-2005, 04:04 PM
At the begingin of your script write ob_start(); and at the end put ob_end_flush();.
raven80
07-13-2005, 11:07 PM
I did as you said but it won't work. Is there any other way ?
Thank you anyway :)
BeachSide
07-13-2005, 11:11 PM
Where did you put the ob_start(); ?
SpectreReturns may have been a bit vague when they said at the top of your script. It should be at the top of the entire page before anything else.
SpectreReturns
07-14-2005, 01:26 AM
Even before any whitespace which may be before the <?php. Make sure this goes on your 'index.php' page.
raven80
07-15-2005, 08:04 PM
it's worked. There are some space line above end tag ?>. Thanks for helping me :)