[thelist] PHP Form Validation

Andrew andrew at efficiente.co.uk
Mon Jan 6 10:47:20 CST 2003


Hi All

I have been creating a contact form and tell a friend form and need a view
pointers.  The tell a friend form needs to validate two email addresses, the
sender's and the sender's friend.  At the moment I only have this: which only
checks one of the emails ($email) I need to check the $receiver3 =
"<$friends_email>"; also but the code below doesn't like it when I add
friends_email

/*e-mail´s validity is check with this */
if (!eregi ("^[_\\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\\.)+[a-z]{2,4}$", $email))
$error_message = "A valid e-mail address is required.";

Another part of this problem is (which is prossibly part of the answer) the same
error message will apply to both missing fields and I reaaly want two different
messages.

Thank  you
Andrew



Tel: +44 (0) 777 55 212 95

**********************************************************************
Information in this email is confidential and may be privileged.
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system.
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone.
Thank you for your co-operation.
**********************************************************************




More information about the thelist mailing list