User Login and registration

Hi,
Lately I have seen games that have the ability to have users register and login. Does anyone have a script that accomplishes this that they would be able to share? If not, can anyone possibly lead me in the right direction?

Thanks

The easiest way to do this is store the username and password in a hashtable, with the password being the hash key and if
username == hashTable[password] then they should proceed to login.

Make sure to serialize the hashtable to either some local file on the computer or somewhere online.

Ok got that, thank you very much. What im having trouble with is getting the data to and from the data base. I have not been able to interface any of my games with Mysql