http://www.php.net/manual/en/function.ob-start.php
I've used it to prevent anything from being sent to the browser, when I need to set multiple cookies using headers.
ob_start();
$time = mktime()+64800;
$date = date("l, d-M-Y H:i:s", ($time));
$url = $HTTP_SERVER_VARS["REQUEST_URI"];
header ("Set-Cookie: BackToResults=$url; expires=$date GMT; path=/;");
header ("Set-Cookie: RequestURI=$url; expires=Friday, 16-Jan-2037 00:00:00 GMT; path=/;");
$cookielogin = $login = $HTTP_COOKIE_VARS["logged"];
$cookiepasswd = $HTTP_COOKIE_VARS["passwd"];
if ( !isset ($cookielogin) && !isset ($cookiepasswd) )
{
header ("Refresh: 0; url=../projects/classifieds/login.php3");
ob_end_flush();
Without ob_start, setting multiple headers in a row would be impossible.
Richie.
geocities.com/akindele/