ive used this error checking methods for email and username in my registration form
i want to use the same method but with an added one for (comments) as building a guestbook
can someone show me what to do please for checking this as am stuck, cheers.
//Check for an email address.
if (eregi ("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$",stripslashes(trim($_POST['email'])))) {
$e = escape_data($_POST['email']);
} else {
$e = FALSE;
echo '<p><font color="red" size"+1">Please enter a valid email address!</font></p>';
}
//Check for a username.
if (eregi ("^[[:alnum:]_]{4,20}$", stripslashes(trim($_POST['username'])))) {
$u = escape_data($_POST['username']);
} else {
$u = FALSE;
echo '<p><font color ="red" size="+1">Please enter a valid username!</font></p>';
}