#----------------------------------------------------------------#
# Check to see if the email address is in valid form
$valid_email = "1";
if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/ ||
($email !~ /^.+\@localhost$/ &&
$email !~ /^.+\@\[?(\w|[-.])+\.[a-zA-Z]{2,3}|[0-9]{1,3}\]?$/)) {
$valid_email = "0";
}
if ($valid_email eq 1) {&error_msg('Invalid Email Address');
}
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.
richjb posted this at 06:23 — 31st July 2000.
They have: 193 posts
Joined: Feb 2000
This code is for PERL:
unless ($INPUT{'email'} =~ /.*\@.*\..*/) {
print "invalid email format";
exit;
}
Hope that helped.
Richard
[email protected]
Everyone here has a website. It's just that not all are worth posting (Mine!
).
roBofh posted this at 13:58 — 31st July 2000.
They have: 122 posts
Joined: Jun 2000
Personally, I like using the Email::Valid module since it does a little bit more comprehensive test, and someone else updates it to keep it current
-rob
Rob Radez
OSInvestor.com
richjb posted this at 15:26 — 31st July 2000.
They have: 193 posts
Joined: Feb 2000
Rob:
Please post syntax.
Richard
roBofh posted this at 22:17 — 1st August 2000.
They have: 122 posts
Joined: Jun 2000
Use Email::Valid;
Email::Valid->address($email);
perldoc Email::Valid for more info.
-rob
richjb posted this at 19:09 — 2nd August 2000.
They have: 193 posts
Joined: Feb 2000
Thanks.
Richard
Tiffany_M posted this at 22:40 — 2nd August 2000.
They have: 16 posts
Joined: Aug 2000
#----------------------------------------------------------------#
# Check to see if the email address is in valid form
$valid_email = "1";
if ($email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/ ||
($email !~ /^.+\@localhost$/ &&
$email !~ /^.+\@\[?(\w|[-.])+\.[a-zA-Z]{2,3}|[0-9]{1,3}\]?$/)) {
$valid_email = "0";
}
if ($valid_email eq 1) {&error_msg('Invalid Email Address');
}
HTH
Tiffany
Tiffany Ring
Go Shoeless!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.