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?
rajkumar_pbConnect With a Mentor Commented:
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

Ray PaseurConnect With a Mentor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.