May 2003
Intermediate to advanced
592 pages
14h 28m
English
You’ve certainly come across sticky forms, even if you didn’t know that’s what they were called. A sticky form is simply a standard HTML form that remembers how you filled it out. This is a particularly nice feature for end users, especially if you are requiring them to resubmit a form.
To preset what’s entered in a text box, use its value attribute:
<input type="text" name="name" size="20" maxlength="40" value="Brian" />
To have PHP preset that value, print the appropriate variable:
<input type="text" name="name" size="20" maxlength="40" value="<?php echo $_POST['name'];?>" />
With this in mind, I’ll rewrite register.php ...
Read now
Unlock full access