Jump to content

Integrating multiple logins


pr3da70r

Recommended Posts

Hi everyone! I'm new here, and also new to php. Loving it so far though!

 

Basically I have 3 different scripts on my site currently, and each has a separate database, and a separate login.php file, set up in a different way. Now this is probably a long shot but, here's what I was thinking.

 

Let's say each script has its login.php named as login1.php, login2.php, and login3.php respectively. Can I set each login.php so that if the user successfully logs in using one, it calls the other two phps as well, thus logging the user in to each individual part of the site? Ofcourse for this the users will have to have the same username and password in all 3 databases, which I can easily enforce by integrating the registration function similarly.

 

So what I'm trying to do is, something like this...

login1.php would have..

 

// run sql queries to make sure the username and password is correct
........

// if username is correct, making sure login2 and login3 don't md5 the password again, and 
// also making sure username and password are stored in the proper variables.
log in to the first section of the site
include("/section2/login2.php");
include("/section3/login3.php");

// if username is incorrect just give the error as you would on an unsuccessful login.

 

 

Would this work? Why or why not? Any other suggestions on how this could easily be implemented? If it helps any, SMF is one of the 3 sections I'm trying to integrate  :P

 

Thanks everyone! This is really confusing me, and it's very crucial to my site, ofcourse, since it's a total pain having to log in 3 different times to be able to use the different sections..

 

Truly will appreciate the help :)

-Pred

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.