|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
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?
|
|
#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.
|
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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 ;)
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > PHP header() and setcookie() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|