PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi guys, I'm just wondering if anyone has a code snippet for validating an Email string. You know, checking for the '@' symbol, and a '.' and making sure the '@' symbol isn't first and the whole string is a certain length, etc.
I guess I can program it myself but if there is a solid one already I may as well use it
Sorry to be extremely picky about this, but I must: what the HELL is the point of e-mail validation!? I mean really...unless there was some way to make sure that the actual person OWNED the e-mail adress they put in...it is COMPLETELY pointless. So say i put in the letter 'x'....your validation script wastes SPACE and TIME, checking for certain things. So it tells me i need an '@' symbol with stuff before and after it, etc. So I go back and write 'bob@aol.com'...CONGRATULATIONS, my e-mail address was incorrect, yet it was accepted anyway...thus proving that your validation is pointless!
I somebody wants to BS an e-mail address, the only thing u are doing is making it take 5 seconds longer.......
brian, I think its to save people from mispelling their email address
I had many entries where people forgot the @ symbol or put me@aol and forgot the.com or made some other mistake in their address. if someone wants to put a bad addy in, they always can but at least make them put it in the right format
Of course it cannot totally validate a real email address but it does make the form look professional. At least you won't have idiots entering simply 'Joe' as their email address.
In my case only people trying to contact me will use the form so I don't mind the test.
Can you imagine how unprofessional your site would look if a guy entered 'Death' as their email address and the mail() function actually went through ?