possien Posted November 15, 2009 Share Posted November 15, 2009 I am building a tabbed page that within each tab (division) i have a login form. Each tab(division) is to log in to a different database. How do i connect the user to that database and send them to their admin page? I.e. there are 4 login forms on a page. I want to send them to their admin page when they login on that form. Link to comment https://forums.phpfreaks.com/topic/181563-multiple-login-forms-on-one-html-page-for-different-databases/ Share on other sites More sharing options...
alpine Posted November 15, 2009 Share Posted November 15, 2009 Either you set different form actions on each form, or use a common page to send the user depending on where you want them to go, example <?php // login_router.php session_start(); if(isset($_POST['submit'])){ $_SESSION['area'] = $_POST['destination']; switch ($_POST['destination']){ case 'area1': header('Location: http://www.example.com/area1.php'); break; case 'area2': header('Location: http://www.example.com/area2.php'); break; default: header('Location: http://www.example.com/area.php'); } } ?> <!-- One of the tabbed pages form --> <form action="login_router.php"> <input type="hidden" name="destination" value="area1" /> <!-- or use a select drop down or whatever --> <input type="submit" name="submit" value="Log in" /> </form> Link to comment https://forums.phpfreaks.com/topic/181563-multiple-login-forms-on-one-html-page-for-different-databases/#findComment-957828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.