Can someone help me with cookies ... i need to set a cookies with 2 variables and then check that cookie for those variables and display a message is they are present.
Can anyone help ?
Greg
need some help with cookies ...
Moderator: General Moderators
sure.
start by reading this page [php_man]setcookie[/php_man]
read the user comments too, they are your friend.
start by reading this page [php_man]setcookie[/php_man]
read the user comments too, they are your friend.
Code: Select all
<?php
setcookie('name', 'value');
// keep in mind you cant check if the cookie was set
// until the next time the browser requests a page
if (isset($_COOKIE['name'])) {
echo 'cookie was set.';
}
?>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact: