this may be out of the realm of stackoverflow, but I have a problem. I am trying to automatically insert the name of the College/University every one of my signups attends. They can only use a .edu email to signup and I was wondering If there were a way to see the College or University the email belonged to?
Ex:
Would return:
The University of Akron
Or does someone know where I could find such a directory?
Thanks
You can populate a MySQL table with all the university names and their email domains. Here is a sample directory that you can perhaps start with.
Once you’ve done that, you can parse the user’s email for the domain. Here is a very similar answer on how to get the domain name from an email address.
Once you have got the domain from the user’s email, retrieve the university/college’s name from the MySQL database. (If it does not exist, it’s worth logging since it could be a new domain name that is not in your database yet)