 |
TemplatePower Forum Ask your question about TemplatePower here!
|
| View previous topic :: View next topic |
| Author |
Message |
Templati
Joined: 03 Mar 2006 Posts: 1
|
Posted: Fri Mar 03, 2006 9:33 pm Post subject: Warning: Cannot modify header information ! |
|
|
Hello,
it's a common warning that .. and it's keep appearing to me with template power when I use any headers .. or with cookies !
I really tired, anyone can help ?
| Code: |
Warning: Cannot modify header information - headers already sent by (output started at **/tpl.php:585) in **/functions.php on line 51
|
this is the line 585 from tpl.php :
| Code: |
print($this->defBlock[$defblockname][$k]);
|
and this is the line 51 from functions.php (my file) :
| Code: |
setcookie($name2,$value,$expires,$cookie_path,$cookie_domain);
|
I can't make login or logout system with template power .. cause of this problem ..
can't download attachments with header function ..
what's the wrong ? |
|
| Back to top |
|
 |
illutic
Joined: 03 Mar 2006 Posts: 3 Location: the Netherlands
|
Posted: Sat Mar 04, 2006 9:02 pm Post subject: |
|
|
just use ob_start(); on the top of your page(s) (above everything else) and ob_end_flush(); on the bottom of your page(s) (below everything else).
So, ob_start has to be the first function used (before any output) and ob_end_flush the last function.
This is a common php-error, because you've already sent output to the browser and the headers should be the first ones to send out (according to php).
With these php functions, you will first buffer everyting and then print it out all at once, without having php complaining about headers sent or anything like it. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|