I have an application that will run on other domains. The application needs to check if an email address matches the domain of the site running the application.
So, if email = fred@example.com ,
- if application is running on example.com , return true
- if application is running on anything.example.com, return true
- if application is running on domain.com, return false
I understand that the $_SERVER variables might be incorrect due to spoofing. So what is the best way for the server running the application to get the server's domain name?