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
Code Snippet
<?php
// this code just saves the text
// "King Kong" into a user's cookie
// named "Beast"
setcookie("Beast", "King Kong");
// done
?>
To use the code above, click and drag your mouse
over the code to highlight it. Then right click on the highlighted
code and click "Copy." Now you may paste it into your code editor.
|