Ok, does anyone know any GOOD tutorials on creating you own functions? I've never done this and tried this morning but the function didn't do what i wanted it to. I tried making a function that would check that the characters in a email is valid. Here is my function:
function valid_email($email)
{
$email=strtolower($email);
if (eregi("!#$%^&*()=+/}{][;:\|,?`~", $email)) {
return false;
} else {
return true;
}
}
and then after they enter there email i put this:
if (valid_email($email)) {
echo("successful");
} else {
echo("failed");
}
and it always comes up successful even if you use illegal characters. What i want to happen is if their email is not valid they will be taken back to the form and if it is valid it will mail the email...can anyone help me?
btw. does anyone know ALL the invalid characters in an email?