note 9992 added to Cookies
| From: | marcel at databasenews dot com | Date: | Tue, 05 Dec 2000 14:29:20 +0000 |
| Subject: | note 9992 added to Cookies | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8419@lists.php.net to get a copy of this message | ||
For those of you who "REALLY" want to display data or information before setting a cookie:
Try using the output control functions at : http://www.php.net/manual/ref.outcontrol.php
Using those functions you can actually send information a browser before setting a cookie or sending
a header.
so, according to the manual, this should work:
<?php
ob_start();
echo "Hello\n";
setcookie ("cookiename", "cookiedata");
ob_end_flush();
?>
go ahead, try it...
http://www.php.net/manual/features.cookies.php