AJAX Login System Demo

Creating a secure login system using XMLHttpRequest

This is an example of a login system that does not require page refreshes, but is still very secure. Valid usernames and passwords for this demo are user1/pass1 and user2/pass2. Try these, and also incorrect passwords to see the results.

Please note that this is not a functional form, your input will not go anywhere. It is solely for demonstrating an XMLHttpRequest login system in javascript.

Advantages

Disadvantages

Demonstration

Source

Questions

Can I copy your code?
Sure, although I'd recommend you rewrite it as you go so you can actually learn something useful. Also, passing someone else's code as your own is just uncool.

Why didn't you use [insert technology here]?
Basically I haven't done web development in close to a year, so I used what I knew best (PHP/MySQL) and used the Javascript that I remembered, along with a little bit of refreshing my memory. Perhaps I should have used object-oriented PHP or Javascript, but this works. If it is slightly confusing, I apoligise, this is only meant as a proof-of-concept.


Created: 28 Jan 2005.

Last updated: 1 Dec 2005. Copyright © 2005.