How do you store data? eg. passwords?
Moderator: General Moderators
How do you store data? eg. passwords?
Say I wanted to make a php file that when someone enters their username and password in a form hashes it and compares it to the already hashed stored password, what kind of file would the hashed password have to be in?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: How do you store data? eg. passwords?
Don't use a file, use a database. If you do need to use a file then make sure you place it somewhere outside of the web root, although on many shared hosts other people will still be able to read this file using php.m0u53m4t wrote:Say I wanted to make a php file that when someone enters their username and password in a form hashes it and compares it to the already hashed stored password, what kind of file would the hashed password have to be in?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Just because data is hashed doesn't mean you can make your list of users and passwords publically accessible.... they'd be brute forced/tunnelled pretty quickly.m0u53m4t wrote:If the passwords are stored hashed anyway, whats the problem? Anyway, I'll use a database... So how do I make a database for it?
Read up on MySQL or PostgreSQL if you want to learn how to use a database