PHP form register but for non-free email web based

Hello all,
I am creating a php form so that users can register with my application, but I don't want any web-based free email address to join, for example, ,

Is there some mechanism to do that?
Thanks in advance
LVL 17
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Just extract the characters came after the @ symbol and validate it against any free email providers either from Array or using DB. If it matches, then throw the request back to form and ask user to enter some other email IDs.

Code is

$email = $_POST['email'];

$validator = explode('@', $email);
$check = $validator[1];
$d1 = explode('.',$check);
echo "D1 is :".$d1[0]."<br/>";
if($d1[0] == 'yahoo')
/* Here check the value against array of free email providers*/
 echo "Free email provider";
 echo "Paid one!";

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ray PaseurCommented:
If you follow that design pattern, you'll leave me out because I use GMail.  I know literally hundreds of people who use free email addresses, and while some of the free email addresses are undoubtedly junk and noise, I would guess that more than half are real humans.  You might want to look for a more reliable way to separate the wheat from the chaff.  Couple of ideas...

When a registration occurs, place the newly registered record into your data base marked "inactive" then send the email address a link to a script to activate the email address.   The registrant has to click the link to active the account.  This two-way handshake may help you be sure that you're talking with real people.

Or, just put a captcha image on the registration page.

Best regards, ~Ray
houssam_balloutAuthor Commented:
I agree with you Ray,
I had this idea in my head, but they are some requirements to undertake.

rajkumar_pb: there are a lot of these; Is there some way to had them all? Are you they categorized at some place?
Thanks in advance
Ray PaseurCommented:
You might find a list of them here:
No, there is a lot of them and its hard for me to collect them all. Just google it to find top most spammers among them and put them all in a array.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.