0

i'm developing an app that i intend to run on a client's intranet. i want to ensure that only email addresses with the client's domain should be registered. how do i achieve this using regular expressions?

4
Contributors
4
Replies
10
Views
4 Years
Discussion Span
Last Post by dinhunzvi
Featured Replies
  • Are you using PHP 5.2 or above? If so, you could use to validate the email address as a whole: `filter_var('bob@example.com', FILTER_VALIDATE_EMAIL);` And then using strpos and substr extract the domain element and do a string comparison to restrict the domain. Read More

1

Are you using PHP 5.2 or above?

If so, you could use to validate the email address as a whole:
filter_var('bob@example.com', FILTER_VALIDATE_EMAIL);

And then using strpos and substr extract the domain element and do a string comparison to restrict the domain.

Edited by blocblue

0

if you like use jquery funcution email validata . very sample just you search email validation jquery function .

0

@lixamaga it's not safe because a user can disable javascript and submit malicious data, a server side filter, as blocblue suggested, is a necessary requirement.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.