Articles: 843 | Categories: 148   
   
   
Home Articles Contact Us
 
 
 
 
Save Info to a Cookie With Variable (0 Comments)
Admin: Posted Date: March 3, 2010

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.

 
 
Add a Comment:
 
(You must be signed in to comment on an article. Not a member? Click here to register)
   
Title:

Comments: