The code for sending this form data to the server:

<form method=get action="name.php">
<input type=text size=18 name="user">
<input type=submit value="Send it">
</form>

What's your name?


And the content of the script that sets the cookie...

<?php
if(isset($_GET['user'])){
setcookie('user',$_GET['user']);
}
?>