Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Custom PHP Blog - Login details

I want to try and make a simple blog just for practice, but I am unsure where I would store the login details so that they would be kept safe. I will be the only person logging in so I only need to store a single name and password. Any suggestions?

1 Answer

if this is just for practice, simply store them in a 'users' table in your database. If you want to get a little more secure, then look up adding a hash to the password before storing it, and then look at adding a salt to it as well.

As a side note I think this is one of the best series of tuts out there for a login/registration system (I don't think we have a series like this here on Treehouse). It will give you a very solid foundation for not only a login system in php but also OOP with php. OOP login - registration

Of course if you want level up on OOP before watching how to use it to create the login system, be sure to check out Hampton Paulk 's series here on treehouse PHP OOP

Thanks for the info. It is for practice but I plan to put it online too. I was thinking of doing what you said about the user table, but i only plan to have one user (me) and I wasn't sure if that would be overkill. Maybe I'm just over thinking it. :)