TemplatePower Forum Forum Index TemplatePower Forum
Ask your question about TemplatePower here!
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Warning: Cannot modify header information !

 
Post new topic   Reply to topic    TemplatePower Forum Forum Index -> Coding Help
View previous topic :: View next topic  
Author Message
Templati



Joined: 03 Mar 2006
Posts: 1

PostPosted: Fri Mar 03, 2006 9:33 pm    Post subject: Warning: Cannot modify header information ! Reply with quote

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
View user's profile Send private message
illutic



Joined: 03 Mar 2006
Posts: 3
Location: the Netherlands

PostPosted: Sat Mar 04, 2006 9:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    TemplatePower Forum Forum Index -> Coding Help All times are GMT
Page 1 of 1

 
Jump to:  
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