Get Login Data from PHP MySQL database instead of ERPNext database

I have many ERPNext applications installed on different sub-domains. All the login details of these apps is synced into central MySQL database. Now i want to login into all ERPNext app with my own PHP login page instead of ERPNext login page.

Means I want to bypass the ERPNext login page. Please help me regarding this. Thank you very much for your support.