Hello all.
How would I go about setting another name-value pair within a cookie? I can't figure out the correct syntax. So far I have:Any help is greatly appreciated.Code:setcookie("user_id", '.$row->user_id.', time()+86400);
Printable View
Hello all.
How would I go about setting another name-value pair within a cookie? I can't figure out the correct syntax. So far I have:Any help is greatly appreciated.Code:setcookie("user_id", '.$row->user_id.', time()+86400);
why not just set a cookie array?
PHP Code:<?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";
}
}
?>
Thank you ALL.