2

Good Morning,

I'm starting a PHP/MySQL project that will include a registration page where the user will be prompted to enter their email address. The requirement is that certain email address domains will not be permitted access to the website. We want to disallow registration of such user's but not sure how to make this happen.

One thought was to populate a list of "bad domains" in a MySQL table, and use PHP to check the email address supplied against the "bad domain" table. If there's a match, the user is given a message box stating that registrations aren't permitted from their email domain.

Is there another approach that is easier to manage? Are we on track with the above approach? Please let me know how you would tackle this challenge, and/or if you've had to done this before.

Thanks, Sid

1

2 Answers 2

2

You will have to hold a list of "bad domains" somewhere, and it will have to be maintained. Better in an SQL table than PHP. Seems like you are on the right track to me.

0

I would use a text file (Black.list) for the list of bad domains. It could be very easy to maintain this way. Otherwise, you will have to write a script to update the MYSQL database.

You could also use globbing, and allow comments in the file.

--Dave

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.