View Full Version : How can I do this:

03-11-2004, 05:47 PM
Ok, I will be using this for a shoutboX:

if (isset($_COOKIE['CookieName'])) {
// If "CookieName" is set, do this!!!
} else {
// If "CookieName" is NOT set, do this!!!

Now, I want to read the username from the cookie and put it into a text field. How can I do this?

03-11-2004, 06:12 PM
Basically, you can just echo it into the text field i.e.

echo '<form action="form.php" method="POST" id="f1">';
echo '<input type="text" value="'.$_COOKIE['CookieName'].'" id="name" />';
/* Rest of form, etc. etc. */
echo '</form>';
else { do_whatever_you want(); }
?>Hope this helps.