[SOLVED] Help on Cookie!
Posted: Tue Mar 22, 2005 7:10 am
I can't find any documentation to help on this problem, so I post it here.
Everyone knows these code are in the php manual. But (at least as I know) they don't mention how to update the cookie. That means, how do I change the value in "cookie[two]" to "another_value" other than "cookietwo"? Or, how to delete the "cookie[one]" from the "cookie" array? Please help me out.
feyd | Please review how to post code using
Code: Select all
<?php
// set the cookies
setcookie("cookie[three]", "cookiethree");
setcookie("cookie[two]", "cookietwo");
setcookie("cookie[one]", "cookieone");
// after the page reloads, print them out
if (isset($_COOKIE['cookie'])) {
foreach ($_COOKIE['cookie'] as $name => $value) {
echo "$name : $value <br />\n";
}
}
?>feyd | Please review how to post code using
Code: Select all
andCode: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]