Re: Mail-id validation script
| From: | Jasper Bryant-Greene | Date: | Sat, 13 Aug 2005 05:14:54 +0000 |
| Subject: | Re: Mail-id validation script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220548@lists.php.net to get a copy of this message | ||
Nahalingam Kanakavel wrote:
Now I am doing a project using PHP, in that I created a form. That form has a field called e-mailid, to validate that I need a script (function), whether I have to write it in the server side or client side, which one is better?. I need your suggestions, If any script is there plz send it to me.If I was creating such a script I would validate it both on the client-side and the server-side. The reason for this is that client-side validation can be fooled, but server-side validation requires a round-trip to the server. If you validate on the client-side you will save your users time as errors will be detected without a trip to the server, but you still need to validate on the server-side to ensure that they haven't bypassed the client-side validation in any way. As far as an actual script goes, either read the relevant RFC for email addresses at [1], or just Google for PHP email validation [2]. Jasper [1] http://www.ietf.org/rfc.html [2] http://www.google.com/search?q=php+email+validation