Question about Cookies
| From: | Andrew Phillips | Date: | Fri, 05 May 2000 17:12:23 +0000 |
| Subject: | Question about Cookies | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18456@lists.php.net to get a copy of this message | ||
Hello,
I have been trying to get a cookie to be created and I just can't get it to
work. If any one could help me out
by email or ICQ me (72178276) with any suggestions. I have attached the
code, if you could help me I could possibly
be a good person to bounce code ideas off of on ICQ.
-Andrew Phillips
Code:
<head><meta http-equiv="Refresh" content="5;
URL=infochange.php"><? //
Variable Listing for ease of coding
// $Banker_Last, $Banker_MI, $Banker_First, $ORC,
//$Banker_Location, $Internal_Mail_Code,
// $Banker_Area, $Banker_Zone, $Banker_Loc
// These are the Phone Information
// $Banker_Fax_Area, $Banker_Fax_Zone, $Banker_Fax_Loc,
// $Banker_Email Fax Information
// Set the Array for Encoding
$Cookie_Array = array( "$Banker_Last", "$Banker_MI",
"$Banker_First",
"$ORC", "$Banker_Location", "$Internal_Mail_Code",
"$Banker_Area", "$Banker_Zone", "$Banker_Loc",
"$Banker_Fax_Area", "$Banker_Fax_Zone", "$Banker_Fax_Loc",
"$Banker_Email" );
// Now Serialize the Array
$Serialized_Array = serialize($Cookie_Array);
// Getting the current date
$hour = date("H:i:s");
$year = date("y");
$year + 900; // Adding 900 years to the current year
$day = date("d-M-") . $year;
$day_off_the_week = date("l");
$validation = $day_off_the_week . ", " . $day . " " . $hour . "
GMT";
// Set a cookie's value.
header("Set-Cookie: EFEapp=$Serialized_Array; expires=$validation");
?>
</head>