RE: [PHP] last questions
Here's a function you could use. The input from your form should be email ($email in this script). function valid_email($email) { // check an email address is possibly valid if (ereg([EMAIL PROTECTED], $email)) return true; else return false; } HTH Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -Original Message- From: Jason k Larson [mailto:[EMAIL PROTECTED] Sent: 28. maaliskuuta 2003 5:33 To: Haseeb Iqbal Cc: PHP General list Subject: Re: [PHP] last questions Search the list archives, this question gets asked (and answered) a lot. http://marc.theaimsgroup.com/?l=php-general HTH, Jason k Larson Haseeb Iqbal wrote: thanx to all those who replied to my previous question. 1 more question.i need help with reqular expressions.i want to check valid (email) usernanes for my mail server .i.e. Qmail. any help welcome. thanx in advance Haseeb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] last questions
Steve, et al -- ...and then Steve Jackson said... % ... % // check an email address is possibly valid % if (ereg([EMAIL PROTECTED], % $email)) ... You could just downcase the address and save some chars; email is case-insensitive. You've left out the '+' character used for name+extensions under sendmail (and perhaps postfix). You allow an ending . on a hostnmae, which you shouldn't. It looks like you could switch your two [] expressions on the right side and lose the \. in the middle and be OK. % % HTH HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] last questions
someone has asked the same question today about validating email, do a search i'll find the reply. - Original Message - From: Haseeb Iqbal [EMAIL PROTECTED] To: PHP General list [EMAIL PROTECTED] Sent: Friday, March 28, 2003 4:02 AM Subject: [PHP] last questions thanx to all those who replied to my previous question. 1 more question.i need help with reqular expressions.i want to check valid (email) usernanes for my mail server .i.e. Qmail. any help welcome. thanx in advance Haseeb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] last questions
Haseeb, Here is a great tutorial regular expression. http://www.phpbuilder.com/columns/dario19990616.php3 Jonathan Pitcher On Thursday, March 27, 2003, at 10:02 PM, Haseeb Iqbal wrote: thanx to all those who replied to my previous question. 1 more question.i need help with reqular expressions.i want to check valid (email) usernanes for my mail server .i.e. Qmail. any help welcome. thanx in advance Haseeb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] last questions
Haseeb -- ...and then Haseeb Iqbal said... % % thanx to all those who replied to my previous question. Happy to help! % 1 more question.i need help with reqular expressions.i want to check valid % (email) % usernanes for my mail server .i.e. Qmail. any help welcome. It's come up before, so the first place to look is the archives. It's pretty easy to check for a legally formatted mail address; it's a bit trickier to check for a valid right hand side; it's impossible to check for a valid left hand side unless it's your own machine. Basically, and from the top of my head, an email address is a letter or number any number of letters, numbers, underscores, dashes, plusses, periods an @ either a letter any number of letters and numbers, perhaps separated by periods a period a TLD (currently 2, 3, or 4 letters) or an IP address and so it gets a little hairy to write but it can be done. You might also do a quick google search for something like email address regular expression check to see if someone has worked out a good and complete one. % thanx in advance % Haseeb HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] last questions
Search the list archives, this question gets asked (and answered) a lot. http://marc.theaimsgroup.com/?l=php-general HTH, Jason k Larson Haseeb Iqbal wrote: thanx to all those who replied to my previous question. 1 more question.i need help with reqular expressions.i want to check valid (email) usernanes for my mail server .i.e. Qmail. any help welcome. thanx in advance Haseeb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php