PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old June 6th, 2002, 05:55 AM
imeg4fun12 imeg4fun12 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 1 imeg4fun12 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
PHP header() and setcookie()

whenever I try to use the header() or setcookie() functions on my apache 2.0.36 server with php 4.2.1 it says that the output was already generated at [scriptlocation/fubar.php:first<?php tag line#] and that the output could not be added. any ideas?

Reply With Quote
  #2  
Old June 6th, 2002, 07:38 AM
Smiley Smiley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Australia
Posts: 30 Smiley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: PHP header() and setcookie()

You have to get rid of ALL whitespace before the first <?php tag. Becuase that is still output. The php parser outputs anything that's not in php tags.

Reply With Quote
  #3  
Old June 6th, 2002, 07:11 PM
greggory greggory is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Reims, France
Posts: 82 greggory User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: PHP header() and setcookie()

Right

To avoid it, user ob_start() at the very first of your script (Before any whitespace )
And ob_end_flush() at its very end

Reply With Quote
  #4  
Old June 6th, 2002, 07:47 PM
CmdrDats CmdrDats is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: <br><img src='http://www.dats.co.za/icon.gif'>
Posts: 269 CmdrDats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to CmdrDats Send a message via AIM to CmdrDats Send a message via Yahoo to CmdrDats
RE: PHP header() and setcookie()

Or simply edit your php.ini and set "output_buffering" to "on".. then you can have as much whitespace as you like ;)

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > PHP header() and setcookie()


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway