A quick look @ cookies :
Cookies are usually set in an HTTP header ( though JavaScript can set a cookie directly on a browser).
You can set a cookie in a PHP script in two ways. You can either use the header() function {not the most preferrable way, not for me anyway}
header() requires a string that will be included in the header section of the server response. Because headers are sent automatically for you, header() must be called before any output at all is sent to the browser.
header("Set-Cookie: name=$name; expires=Wed, [ic:ccc]27-Nov-02 15:02:33 GMT; path=/; domain=deadlysin3.net " );
Setting a cookie like in the example above, would require you to build a function to construct the header string, which really wouldn't be tough, but, in my opinion, is pointless. PHP has a function that does exactly that.
setcookie() does just what the name suggests it does. It outputs a Set-Cookie header. As I said before, headers must be called before anything is sent to the browser. The function takes the cookie name, value, expiration date in Unix epoch format, path, domain and integer that, unless you're sending a cookie out on a secure server, should be set to 0.
Every argument to this function is optional beside the cookie name.
<?php setcookie( "name", "$name", time()+3600, "/", "$SERVER_NAME", 0 );
/* Sets a cookie that will expire in one hour */
?>
Now, to you give you an example you might be able to use!
Say, on your form... you have a text input box, with the name "name".
(i.e)
<input type=\"text\" size=\"15\" maxlength=\"15\" name=\"name\">
When you process your form, whatever the user inputs into the "name" field can be accessed w/the variable "$name"
So.. if you wanted to get their name again after they've filled out the form, and they have cookies enabled .. set a cookie like in the above example ( you may want to adjust the time on it. in the example above it will expire in 1 hour. ), then, in your form, call for the cookie : it's as simple as that! Really, it is!
<?php
if ( isset( $name ) ) {
echo
"<input type=\"text\" size=\"15\" maxlength=\"10\" name=\"name\" value=\"$name\"> "; }
else
{ echo
"<input type=\"text\" size=\"15\" maxlength=\"10\" name=\"name\"> "; }
?>
All that this is saying, is, if the cookie, titled "name", exists on a users computer, print it in the input box. else, print the normal input box.
Hope that helps : if not, sorry for confusing you even more : /