sohrabdvr Posted January 29, 2009 Share Posted January 29, 2009 Hey everyone, How can I make a Login system which redirects to different pages depending on usernames...? like username1 goes to 1.php, user2 goes to 2.php and so on. What technologies should I know? SQL? PHP?....? Thanks Link to comment https://forums.phpfreaks.com/topic/143052-login-system-which-redirects-to-different-pages/ Share on other sites More sharing options...
elflacodepr Posted January 30, 2009 Share Posted January 30, 2009 I recommend to learn both...You can use any of them (PHP or SQL) depending on what you want to do, but thats up to you. A PHP script would look like this: <?php if($user == $user1) { //Page where "user1" will be redirected } else { //If the person is not "user1" he/she will be redirected here } ?> Link to comment https://forums.phpfreaks.com/topic/143052-login-system-which-redirects-to-different-pages/#findComment-750263 Share on other sites More sharing options...
phparray Posted January 30, 2009 Share Posted January 30, 2009 However you authenticate your user's creds simply redirect them to a particular location. The resulting url will be entirely up to your application design. You would never actually have real files for each user. Instead you make one user home page with dynamic content based on the username provided. #pseudo code if authenticated store username in a session $_SESSION['username'] = $username; redirect to /mypage.php?friend=$_SESSION['username'] Link to comment https://forums.phpfreaks.com/topic/143052-login-system-which-redirects-to-different-pages/#findComment-750358 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.