Forum Moderators: coopster
I have a registration form where people fill their info out submit it and then they can come back to the page, but since I have a cookie, they can click submit without having to fill in their information again.
How would I create an edit info button that sends them back to the regiatration form, with all the fields populated so that they can "edit" their info and re-submit if they want?
Thanks
if (isset($_COOKIE["name"])) {
echo $_COOKIE["name"];
}
A very basic example would be to echo the cookie value where you call your form:
<input type="text" name="name" value="<?php echo $_COOKIE["name"]; ?>">
Remember that cookie values are user-supplied though, so make sure the data is clean before you print it on the page: at a minimum htmlentities(strip_tags($_COOKIE["name"]));