I want to authenticate the user without refreshing/redirecting to another webpage. If the username and password combination is incorrect, I want to show a message there itself without redirecting/refreshing the page. And if the username and password combination is correct, then I want the page to redirect to home page. An example is given below, the error message appeared without refreshing the page. Can anyone help me in get this thing done? Thanks!
Example :
You can do this with the help of making ajax request to your php file, which will then execute your username and password and return true or fase or Other information about request.... This is the simplest way to do something on same page.
Use Ajax! the idea is to use XmlHttpRequest
objects to send requests back to the server and get response.
Google for PHP ajax login:
Using jQuery:
You have at least two choices:
Use AJAX, With it. user doesn't need to reload page to communicate with server.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.