sorcerer2066 Posted March 5, 2009 Share Posted March 5, 2009 Hi I am not at all experienced at php so please bear with me. I have a website with six separate mysql databases. Each section/database has their own pages and each has their own login with users . But this is causing a small problem and ideally we'd like everyone to login to just one database and then go from there to do what ever they want to do. Essentially create a global login for all databases from just one user section. The current login code is pasted in below. Can anyone tell me what I need to change in order to make it 'look' for a certain database in which to confirm user login details? Or am I completely way way off base and this actually utterly impossible to do?? Thanks for your time Jen ________________________________ <? $content = ob_get_contents(); ob_end_clean(); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body onload="xz()" onunload="GUnload()" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <div id='toparea'> <div id='login'> <? if (!isset($_SESSION["email"])) { echo("<form action='".$_SERVER["PHP_SELF"]."' method='post'> Email address:<br /> Password: </div> <div style='width: 280px; float: right'> <input type='text' name='email' /><br /> <input type='password' name='pass' /> <input type='submit' value='Log In' /><br /> <a href='forgot.html'>forgotten password?</a> ".$login_error." </div> <div class='clear'></div> </form>"); } ?> </div> </div> <div> <div id='mainbody' style='width: 1100px'> <? echo $content; ?> </div> </div> </body> </html> Quote Link to comment Share on other sites More sharing options...
revraz Posted March 5, 2009 Share Posted March 5, 2009 Just use one of your DB's as the login database, set a session that they are authenticated, then on each page, just check that session and do what you need to do for that page/user/action. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.