Tuesday, May 30, 2006

php login code

Log in page

Use "test" for both the username and password.

The login code checks the login info against the database. If the username is in the database and the password is correct it logs you in, otherwise it prints "Bad username and password."
source

The logout code destroys the session. For some reason destroying the session doesn't prevent the current page from seeing session data, so to get the logged in/not logged in behavior to work correctly it had to be on a separate page. This is probably better, anyway, since it can just be called like this from anywhere.
source

1 Comments:

Blogger Moni said...

awesome! I'll get to designing this once I finish my papers.

4:14 AM  

Post a Comment

Links to this post:

Create a Link

<< Home