Log in

View Full Version : HELP: Need a simple, secure PHP login.



Birmingham
07-10-2006, 01:49 PM
It's not easy to find a bit of code for a simple, secure php log in. Please post your best knowledge of the subject in this thread.

Twey
07-10-2006, 03:11 PM
You're in luck, I just wrote one (http://www.twey.co.uk/?q=loginscript). Uses MySQL. Easy to adapt to your site design.

Birmingham
07-10-2006, 03:25 PM
cheers twey, that looks very promising, i'll read it tonight - i'll take it to bed with me *lol

i wonder if the "just wanting to get on with it" is of any compromise to the security though :rolleyes:

Twey
07-10-2006, 03:40 PM
Heh, no. It's perfectly secure, don't worry. :)

It lacks some things, though, such as a "forgot password" feature. I was going to implement one, but then realised I had to configure sendmail before I could test it, so I didn't bother.

It has logout capabilities, too, although they were never put to use in the example code. Just link to a protected page with ?logout appended to the URL to create a logout link.

shachi
07-10-2006, 03:55 PM
Hey Twey, I think you should write a tutorial about it.;)

Twey
07-10-2006, 03:57 PM
Heh.
That reminds me: I haven't done any work on that site in a long time. I need to rewrite the frontend...

shachi
07-10-2006, 04:14 PM
It could help me a lot if you do write a tutorial.;) I could learn about sessions and a little more about databases and may be something more(which I don't know that there is something like that).:p

Birmingham
07-14-2006, 05:27 PM
well, after reading all of that code and trying to know exactly what each bit was for - i have to say it doesn't seem simple at all. maybe the only people who could understand it all would be people who could have written it themselves anyway :(