Page 1 of 2
how do icheck that an email
Posted: Wed Jun 30, 2004 1:26 am
by pelegk2
that i have recived is a valid one?
Posted: Wed Jun 30, 2004 2:40 am
by Grim...
Send it a message?
Posted: Wed Jun 30, 2004 3:44 am
by pelegk2
ow no what i mean was how do i check for ligeal email that i recive from user when posted in a form
sorry for the miss understanding:)
Posted: Wed Jun 30, 2004 3:47 am
by markl999
Posted: Wed Jun 30, 2004 5:55 am
by Grim...
I know what you meant.
Send the user a message, perhaps with a word of a four-digit code they need to type in on the next screen.
That way, no email, no entry.
Posted: Wed Jun 30, 2004 6:00 am
by JayBird
I think he means validate an email address
blah@blah.com - validated = yes
blf&*^&@asdas - validated = no
Mark
Posted: Wed Jun 30, 2004 6:19 am
by Grim...
Ah, but:
Matt@hsmx.com = valid
Batt@hsmx.com = invalid
The only way you can ever really know is to send the user an email with information in it.
Posted: Wed Jun 30, 2004 6:23 am
by patrikG
regex help you filter the cream from the crop and thus minimise the number of invalid email-addresses (see Mark's google link).
Posted: Wed Jun 30, 2004 6:24 am
by JayBird
Yup, i know.
The question was not well contructed in the first place by pelegk2.
Please can you read
THIS and make your questions clear and concise. It makes everyones life easier.
Mark
Posted: Wed Jun 30, 2004 5:24 pm
by tim
i think theres still a regex in the code snipplets section that will validate the "layout" of a email address to make sure the form is correct
to make sure tis an actual address, a email validate process of some sort (as suggested)
Posted: Thu Jul 01, 2004 3:21 am
by pelegk2
yes i meant using regex
i want to check that the structure of the email that the user have types is ok
how do i do that?
agaubn sorry if i wasnt clear

Posted: Thu Jul 01, 2004 3:26 am
by markl999
There's 1001 ways to do it. Check the link i posted above for some ways of doing it.
Posted: Thu Jul 01, 2004 4:35 pm
by tim
look in the code snipplets. heres one, not tested but looks good. quck throw-together. As mark said, u could google for this and find it alot quicker then typing a reply
Code: Select all
<?php
preg_match('/^їA-z0-9_\-]+ї@]їA-z0-9_\-]+(ї.]їA-z0-9_\-]+)+їA-z]{2,4}$/', $emailaddress);
?>
this allows for a match of a-z, either cap or not. number 0-9 or _ or - followed by an @ sign, the sequence is repeated, the {2,4} makes sure a .com, .au, etc. would need modified for co.uk endings
none the less, it looks good n should work
Posted: Sun Jul 04, 2004 2:24 am
by pelegk2
ok first thanks alot
second why is the
"'/^" in the begining of the expression?
Posted: Sun Jul 04, 2004 6:48 am
by tim
hello,
/ are just delimiters, it indicated the beginning of an expression pattern, they are not needed.
^ indicates the beginning of a pattern. so anything beginning with a a-z (either cap or lorwecase) or number 0-9, or a _ or -
hope this helps