Jump to content

Archived

This topic is now archived and is closed to further replies.

LBJerryH

Two Databases, One Login

Recommended Posts

I need some help on this. I need to have it where when someone logs into my main site, one database, that login passes to the second database. One login for two databases. Can this be done??? The way the site is set up is the main site is www.fuelmyfaith.com and the secondary site is set up like this: www.fuelmyfaith.com/pligg. They are on 2 seperate databases running their own PHP scripts andI want one login for both. Thanks.

Share this post


Link to post
Share on other sites
You could store the log in table on either database and when you have checked for a successful log in in your script you could just include a different connection to the database as required.

Share this post


Link to post
Share on other sites
The login to the site and the login to the DB are separate... I'm confused.

Share this post


Link to post
Share on other sites
[quote author=wardo link=topic=104681.msg417977#msg417977 date=1155909358]
You could store the log in table on either database and when you have checked for a successful log in in your script you could just include a different connection to the database as required.
[/quote]

Ok, that makes since. Now how would I go about doing this? My database skills are lacking. If you could help me with this, I would really appreciate it.

Share this post


Link to post
Share on other sites
A better way to do it would be:

You would have a table in one of your databases called users for example which stores the username and password. Your log in page would check this database for the username and password that the user enters. If it does not match then a message is displayed telling them so. If the log in is successful a cookie could be set and you could check on either site if the cookie is present to control access.

You would only need one log in page which sets a cookie and you could then check for that cookie on either site. Hope this makes sense.

Share this post


Link to post
Share on other sites
Yup, that's the general idea... one set of login credentials to the outside world, and as many as you want/need on the inside.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.