Need help with user logins

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
User avatar
jolinar
Forum Commoner
Posts: 61
Joined: Tue May 24, 2005 4:24 pm
Location: in front of computer

Need help with user logins

Post by jolinar »

Can anyone help me out with this?

I'm building a gallery program, and I am trying to build in a user authentication system. I am thinking about using sessions and having a list of users, and the user classification mapping them to a mysql account (normal users use a guest account, admin uses one with more priviledges)

What I need really, is a simple explination of the concepts involved and some code (don't need a complex system, I'm only a numpty)
User avatar
Buddha443556
Forum Regular
Posts: 873
Joined: Fri Mar 19, 2004 1:51 pm

Post by Buddha443556 »

I doubt you'll find a simple explanation of the concepts involved. A login page may seem simple but involves a number of different elements. Cookies, Sessions, Validation, Database, Security just to name a few. Entire books have been written explaining the concepts involved. As for code... Nice thing about open source is ... well it's open source. Download something like Gallery (since your interested in coding such a program) and take a look how that programmer did it. Maybe that will give you some ideas. If not there are plenty of other examples to study.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

Buddha443556 wrote:I doubt you'll find a simple explanation of the concepts involved. A login page may seem simple but involves a number of different elements. Cookies, Sessions, Validation, Database, Security just to name a few. Entire books have been written explaining the concepts involved. As for code... Nice thing about open source is ... well it's open source. Download something like Gallery (since your interested in coding such a program) and take a look how that programmer did it. Maybe that will give you some ideas. If not there are plenty of other examples to study.
best post ive seen in ages, couldnt of said it better myself.

remember, always validate the data the user is inputting to stop SQL injection
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply