View Full Version : Email and form validation script
10-23-2002, 05:06 PM
Does anyone have a script that will validate required fields as well as a correct email format on a form?
10-23-2002, 05:13 PM
I DO! I DO! (http://www.peterbailey.net/fValidate)
10-23-2002, 05:14 PM
10-23-2002, 05:29 PM
Originally posted by zoobie
10-23-2002, 06:42 PM
Is there any more documentation on it other then the web site. Not too sure how it works.
10-23-2002, 06:55 PM
I used to maintain a text-file (readme style) document, but between fValidate development, maintaining the website, plus developing my future projects, full-time job, my 2 year old...etc etc - keeping that text document current was impossible, and subsequently cut from my priority list.
You can contact me directly with the contact form (http://www.peterbailey.net/fValidate/site.php?page=contact) on the website
I will give you any support you need, although I suggest you give the API (http://www.peterbailey.net/fValidate/site.php?page=api) a quick readthrough
10-24-2002, 02:03 AM
You can't really validate an email address... unless you send an email to it and make sure it's answered.
Beetle and I had a long discussion about this, and we agree.
The best thing you can do is make sure that the user's email address at least matches a basic email regex, like:
And yeah, apparently + signs AND single quotes are allowed before the @ sign, and you can have a single quote after that (probably because of some screwy email provider)... it blew me away when a customer emailed us kinda ticked off because his email address was similar to:
wasn't valid according to usual email validating regular expressions ((the co.uk wasn't a problem...) and I originally stole the one above from perl, since I figured those guys had a lot of experience with them...).
I've run into a lot of problems with trying to validate "valid" email addresses, I used to use jkd's regex, but that rejected a lot of valid email addresses.
Besides, I can enter firstname.lastname@example.org and it will match any regular expression available for valid email addresses. Your best bet is just to use validation to make sure noone has entered a really bad typo (or "asdf"), and they answer your email. :D
10-24-2002, 02:14 AM
Hey Whammy...I remember our email validation discussion...something I'd like to share...
After said discussion, I decided to look up the RFC specs to determine exactly what IS valid and what is not. After looking for about 30 minutes, I realized why nobody really knows what is valid. Trying to extract any useful meaning from those specs was roughly equivalent to me reading Mandarin Chinese. Upside-down. And drunk. Really...it is pure technical documentation, and I think, not designed to be usable by anyone, but exists merely just to exist.
So, in short, the regex you've got is JUST fine :D
10-25-2002, 12:02 AM
Yeah, it's working ok. I know what you mean, since I did some research on it myself, and basically from what I gather (and I also felt like I was reading Mandarin Chinese while drunk and upside down) an email address theoretically allows anything in a valid *NIX filename... so really it depends on the provider, etc.
Until I find out there are OTHER even STRANGER legal characters in an email address (which at this point wouldn't surprise me!), I'm sticking with that as well. :)
The main advantage I have is I use the above regular expression for a customer service application I wrote, in which customers for several clients (that in total receive several MILLIONS of NON-SPAM (email newsletters) emails per month) will respond to the customer service department of the company. And if something doesn't work, the CS rep lets me know right away.
So when there's a problem, I find out about it pretty quickly. ;)
10-25-2002, 02:12 AM
Originally posted by beetle
...but exists merely just to exist.I can't believe missed an opportunity to use one of my favorite words: existential (http://www.dictionary.com/search?q=existential). :rolleyes:
10-25-2002, 04:10 AM
Talk about good timing. I just started learning about validation yesterday so this thread will help a lot.
Posted a question about the url part today:
which I think is close to being resolved.
I considered making my script's email part work better, but then decided it's good enough for now. Figured as long as the user is allowed to leave it blank (for me it's optional) then they're less likely to enter a fake one.
Reading what you wrote above *validates* my decision. (ha!)
Thanks for all the help,
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.