I have added a "terms" check box to the user registration form in Chapter 18. The registration is successful even if the box is not ticked, although it prints the error message (when not ticked).
Also, is there a way to make the "tick box" sticky like the rest of the registration form?
I got the code I am using (below) from Larry's "PHP for the Web" book.
// Validate the terms:
if ( !isset($_POST['terms'])) {
echo '<p class="error">You must accept the terms and conditions of use.</p>';
}
Table field:
<p><input type="checkbox" name="terms" value="Yes" /> I have read, understood and agree to the <a href="terms.php" title="View Terms and Conditions">terms and conditions</a> of use.</p>