How To Validate An Email Address
Computing : Learning PHP One of the biggest problems with any form is one that collects email addresses. Wary of receiving lots of spam, people will tend to put any old rubbish in this box. In order to check it is a proper address then the best you can do is check that it appears to be in a valid format. To do this, you'll need to check against an ereg expression of a valid email address. Here is a simple ereg you can use which will work in most cases: "[^@ ]+@[^{ ]+.[^@ .]+$" Basically, it passes an address as valid if it meets the: something@something.something format, and checks that the at is not in the right place and there are at least some characters to represent the 'somethings'!
Questions about PHP:
|
|