Jump to content


Photo

Two Databases, One Login


  • Please log in to reply
5 replies to this topic

#1 LBJerryH

LBJerryH
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 17 August 2006 - 09:20 PM

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.

#2 wardo

wardo
  • Members
  • PipPip
  • Member
  • 20 posts

Posted 18 August 2006 - 01:55 PM

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.
www.realdesignnetwork.com

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 18 August 2006 - 04:12 PM

The login to the site and the login to the DB are separate... I'm confused.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 LBJerryH

LBJerryH
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 18 August 2006 - 04:55 PM

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.


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.

#5 wardo

wardo
  • Members
  • PipPip
  • Member
  • 20 posts

Posted 21 August 2006 - 08:51 AM

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.
www.realdesignnetwork.com

#6 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 21 August 2006 - 05:36 PM

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.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users