php – Checking if entered mail ID belongs to a subscriber
In PHP, how can I find if the email entered on a text field belongs to one of the subscribers(subscribed by email)? I am trying to validate the user as a subscriber/non-subscriber to my website before giving access to a passcode. The user will enter his mail ID in a text field, if it belongs to one of the subscribers, the passcode has to be mailed to the same mail ID.
The assumption is that the user is not logged in the WordPress, because most of the readers are lazy to log in is what I noticed.
Currently what I do is manually enter every subscriber’s email IDs in a text file and keep it in the server. And I make line-by-line comparisons with the text field in a PHP code snippet. And if it matches, do whatever is required. So, I want to avoid this hassle of manually updating the text file. Is it possible to access the subscriber database or some simple way through PHP?