Forum Moderators: coopster

Message Too Old, No Replies

Bringing PHP/MySQL Applications Together

User Authentication and PHP/MySQL applications

         

hiker_jjw

12:07 am on Sep 24, 2004 (gmt 0)



I've got a question concerning using multiple PHP/MySQL applications on a single site. For example, say you would like to use a popular Bulletin Board System along with a Chat Script and maybe even a Web Store. Assume all three scripts have their own User Authentication, what's the best way to combine the user login information so that users only have to login once?

Now, I realize that PHP has it's own Session management and that the information can be store in cookies between applications. Let's assume that the three applications have their own User tables and functional design elements to them and they all use PHP for Session management. I'm thinking about two possible solutions, but I want to know other opinions before I start something.

1.) Master User authentication

Design a master User authentication (login) system with subscribe, modify, etc. for Users that would feed the various (three) scripts' User related database/tables. This master user management would use it's only users table and feed the three scripts' user table as needed.

Then modify the three scripts to use the same Session ID name, Session Directory, etc. And then hopefully, the user would not have to login again for each application. The user modify, etc. would have to be removed from the three scripts. This seems fairly feasible.

other possibility...

2.) Modify the three scripts so they use the same MySQL Users database/tables and the same user function calls. I'm thinking that this method would be harder, and probably require a single database connection, and more PHP code changes. It might also be much harder to integrate future versions, etc. of the three scripts.

Anyone understand what I'm trying to say, or have any comments? I'm thinking that 1.) is best solution. Maybe someone has a better idea?

Thanks in advance,
Jeff

rlkanter

7:21 am on Sep 24, 2004 (gmt 0)

10+ Year Member



Depending on how familiar I was with the 3 different sets of code, I'd probably create a new table containing only the username/password probably. Then I'd modify each of the authentication/update password/etc functions to use that table/fields.

Another way would to be use the username/password fields that already exist in one of the tables in the other two.

I've modifed a board system a while back to use the username/passwords that already existed for a customer db, and thats how I went about it.