This snippet shows how to save information to a
cookie using a variable. More informatiom about cookies can be found on
the site.
Save Information to a Cookie using a Variable
This snippet shows how to save information to a cookie using a variable.
<?php
// lets create a variable named
// $strCity and make its value
// New York
$strCity = "New York";
// now save the variables contents
// to a cookie called City
setcookie("City", $strCity);
// done
?>
|