A Login page is one of the basic requirements when creating a registration based website where the user can register to the website and sign in to its account to manage.
In this case, you can use AJAX to create a user-friendly login page.
With AJAX you can directly check the entered username and password are correct or not in MySQL database without reloading the whole page.
If the user is registered then redirect the user to a home page otherwise display an error.