Grant access to a website

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
richie256
Forum Commoner
Posts: 37
Joined: Mon Oct 13, 2003 8:00 pm
Location: Montréal/Canada

Grant access to a website

Post by richie256 »

What is the best way to grant access to a website?

- Encode the login name, the password and IP address of client with the MD5() function and update it in a cookie

- manage access with a MySQL database, update it on every request on the website.

- ??? any other suggestion Please !!! Link to example!

Thanks
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

viewtopic.php?t=6521

Using sessions (combined with a database if so pleases) is ideal. Using IP number is not that great, due to the fact that it can change in the middle of the users session, hence loosing the status as logged in.
Hashing the username and/or the password with MD5() is a good step towards security. It's also supported in both PHP and MySQL. (So you can do it in more than one way).

Check out the link provided for a good tutorial.
Post Reply