eregi help please
Posted: Sun Feb 02, 2003 9:56 am
i have the following code trying to validate an email address...
The problem is in the line that is trying to check for emails starting with 'www'. I am trying to prevent emails with www in the username and ones with the domain name 'setropets.com' to prevent useless email addresses from clodding the db?
Currently it does allow something like http://www.bob@bob.com and bob@setropets.com
any ideas as to what i got wrong?
Code: Select all
if ((strlen($email)>=5)&&(strlen($email)<50)){ //min length 5 and max length 50
if ((!eregi("^їwww]{3}",$email))||(!eregi("\@setroPETS\.com$",$email))){
//the above denies emails starts with 'www' or denies emails with endings 'setroPETS.com'
//to prevent useless emails from being entered
if (!eregi("(їA-Za-z0-9]){4,15}$", $email)){ //prevent emails with 'aaaaaa' or '888888'
if (eregi("^їa-zA-Z0-9\.\_]+@їa-zA-Z0-9]+\.їa-zA-Z0-9\.]{2,4}$", $email)){Currently it does allow something like http://www.bob@bob.com and bob@setropets.com
any ideas as to what i got wrong?