Re: Cookies
| From: | (Miles Thompson) | Date: | Wed, 25 Apr 2001 11:43:57 +0000 |
| Subject: | Re: Cookies | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8866@lists.php.net to get a copy of this message | ||
Tobbe,
The cookie information has to the first thing sent to the browser, ahead of everything else. You sometimes get trapped by having a single empty line at the top of your file.
The page has to be reloaded for content of cookies to be read by the browser.
Netscape has a short article on cookies; you can probably find it by searching for " Netscape cookies " using google.
Miles
At 10:59 AM 4/25/01 +0200, Tobbe wrote:
Hi !! I'm trying to but down 2 variables ($iCount and $sPhone) into a cookie and I used the code example from the php manual from php.net put I only get the error messages (down below) And how do i get back the var in to the page or is there another beter way to save the variables when reloading the page ___________________setcookie ("cookie[two]", $iCount); setcookie ("cookie[one]", $sPhone); if (isset ($cookie)) { while (list ($name, $value) = each ($cookie)) { echo "$name == $value<br>\n"; } }__________________Warning: Cannot add header information - headers already sent by (outputstarted at c:\program files\apache group\apache\htdocs\masscot\delete.php:5) in c:\program files\apache group\apache\htdocs\masscot\delete.php on line 51Warning: Cannot add header information - headers already sent by (outputstarted at c:\program files\apache group\apache\htdocs\masscot\delete.php:5) in c:\program files\apache group\apache\htdocs\masscot\delete.php on line 52 Thanks / Tobbe -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net