views:

113

answers:

3

Hi everybody, I would like to setp up a login form that will included in certain pages.

I found many tutorials that talk about it but, how can I add the "admin" account for the first time ?! In phpmyadmin directly? I can do it but, want it to be encoded with the md5 algorithm. Does anybody know where can I find a ready login system with the session management and all the other stuff?

Thank you very much, regards.

A: 

Hi Zakaria,

you could make some kind of install script for your software which shows a form where the user enters the admin login data. This install script would add this admin and should be deleted afterwards or at least should it have minimal access rights.

But you also can add admins via phpmyadmin or other MySQL admin tools.

If you are looking for complete login solution you should take a look at some of the major PHP frameworks out there.

For example:

Zend Framework or Symfony

There are many more and most of them offer session management and login solutions. But these frameworks might be a bit of a overkill if you are only looking for a simple login script.

Jens
Yes! I think it will be very userful if I could find a simple login system with session management :(
Zakaria
+3  A: 

In PHPMyAdmin insert the Admin user's password with md5

INSERT INTO your_user_table (username, password) VALUES ('admin', md5('secret'));

And in your PHP app, use the native md5() function.

Note that md5() is insecure by now and you want to consider sha1 and salting for increased security. See

Gordon
@Gordon: "Note that md5() is insecure by and you want to consider..." *insecure by* what? My apologies for any apparent grammar-nazism, but it feels like there's a point, or at least a couple of words, being accidentally left out of the sentence... =/
David Thomas
@ricebowl *now*. The missing word is *now*. I was distracted because I had to get my dinner out of the oven :D Nothing wrong with being a grammar nazi :)
Gordon
@Gordon, thanks for the understanding =) And, incidentally, +1
David Thomas
A: 

Have a look at ZendFramework and read some tutorials, like

ZendFramework has excellent authentication and session management.

Roalt
Yes! I think it will be very userful if I could find a simple login system with session management :( – Zakaria 16 mins ago
Zakaria
@Zakaria why not just try to get it working on your own and when you run into issues, come back and ask. A little bit of self initiative is encouraged.
Gordon