There is another option... set 'output_buffering' to some number of 
bytes (around 4000 is probably ok) in your php.ini file.

This will buffer the page in PHP before being sent to the client, so 
things like cookies and headers can be set early-ish in the page, and 
dont absolutely have to go on the first line of PHP code.

The docs state that this will slow down PHP slightly, but Im not quite 
convinced.  A small amount of buffering is a good thing, especially when 
dealing with resources that have a bit of overhead, like TCP sockets or 
filesystems.  That way, if you have a 10000 line HTML page, instead of 
possibly doing 10000 socket write calls, you only do a handful.  And RAM 
is way cheap these days  ;)

-- 

Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424

> Your problem is that you can not send anything to the browser before the
> Header command.
> 
> Only after it.
> 
> HTH,
> 
> Ernani
> 
> "Zac Hillier" <[EMAIL PROTECTED]> escreveu na mensagem
> 006f01c1f372$88e64c20$667ba8c0@affectors">news:006f01c1f372$88e64c20$667ba8c0@affectors...
> Hi,
> 
> Have been coding in asp for the past 18 months but have now decided to move
> our site to php and mysql.
> 
> In asp we used a function response.redirect to send the user to another page
> as required, is there a similar function in php that can work from within
> side the page rather than the header area? We get
> 
> Warning: Cannot add header information - headers already sent by (output
> started at D:\php-dev\includes\lg.php:2) in D:\php-dev\includes\lg.php on
> line 26
> 
> When using header("Location:
> 
> Many thanks for any help.
> 
> Zac
> 
> 
> 



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to