Copy and paste the following code into your body tags and run it (code comments are included).
If you want to see the live result, try it here (new window).
This script set a cookie to save the user information sent by an online form. The online form is displayed only if the cookies has been saved.
The online form:
Implement the setcookie function:
For additional details about handling cookies using php, check out www.php.net/setcookie.