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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to