You are here: Re: heads or tails of email address parser « PHP Programming Language « IT news, forums, messages
Re: heads or tails of email address parser

Posted by -Lost on 02/18/07 06:36

"chadlupkes" <chadlupkes@gmail.com> wrote in message
news:1171779081.479141.299610@q2g2000cwa.googlegroups.com...
>I have this code from someone else, and I'm trying to make heads or
> tails of it because IE doesn't like it. Can anyone help? Or does
> anyone have a better idea?
>
> /* parse the email to check for valid form */
> function parseemail(str)
> {
> str = trim(str);
> <?if(preg_match("/MSIE 5.0;/", $_SERVER['HTTP_USER_AGENT'])) // this
> is IE 5.0
> {?>
> if(str.search(/\w+@[\w\W]+\.[a-z]{3}/) == -1)
> {
> window.alert("Please enter a valid email address");
> return true;
> }
> <?}else{ // not IE 5.0
> ?>
> if(str.search(/^[\w\-\.]+[@][\w\-]+(?:\.[\w\-]+)+$/) == -1) // ||
> str.search(/.+?\@([\w.-]+?\s)/) == -1)
> {
> window.alert("Please enter a valid email address");
> return true;
> }
> <?}?>
> }

I swear this looks like PHP and JavaScript.

-Lost

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация