you can do something with javascript, but it may not be "secure". I think if someone knows the page your trying to "login" to they can book mark it and get in. You might need something more with a database and php to make it more secure.
i haven't done this for a long time, so i just copied froom somewhere:
|