Using Cookies
| From: | Todd Cary | Date: | Sat, 10 Mar 2001 16:59:36 +0000 |
| Subject: | Using Cookies | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-43321@lists.php.net to get a copy of this message | ||
This is a test script so I can get an understanding of Cookies. What am
I missing with this? $cookieuser never gets a value.
<?
$user = $HTTP_GET_VARS[user];
$pw = $HTTP_GET_VARS[pw];
$cookieuser = $HTTP_COOKIE_VARS[user];
if (!$cookieuser) {
setcookie("user", $user, time() + 864000);
print("Setting a cookie<br>");
}
print("The user is " . $user . "<br>");
print("The password is " . $pw . "<br>");
if (empty($cookieuser)) {
print("No cookie was set...will set one<br>");
} else {
print("Cookie user name: " . $cookieuser . "<br>");
}
?>
--
Todd Cary
Ariste Software
todd@aristesoftware.com