allow characters in an email validator

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
glennn
Forum Newbie
Posts: 3
Joined: Sun Mar 30, 2003 5:13 pm

allow characters in an email validator

Post by glennn »

have a simple mail form that validates the address - i need this validator to allow periods and dashes, but i can't figure it out. please help from someone?


if (!ereg('^[-!#$%&''*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&''*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&''*+\\./0-9=?A-Z^_`a-z{|}~]+$', $recemailto[$i]) || ereg("'", $recemailto[$i])) {
$recemailerror = "1";
$send = "no";
}
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Post Reply