Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Andrea Zepeda
90 PointsUser Login
Hi! Im making a login system and i finally make the thing work... But now i have to check wich user logged in and direct him to a profil page. Of course is a profile page that i already made and cant be modify just know.
But i dont know how to do it... Could you please give and advice? That would be great! :) Thanks!
2 Answers
Andrew McCormick
17,730 Pointsif you log the user name to $_SESSION. Then you can do something like:
redirect_to($_SESSION['username']."_profile.php");
Andrea Zepeda
90 Pointsjmmm
Andrea Zepeda
90 PointsAndrea Zepeda
90 PointsOh ok ok... so i have to redirect to the new page. If i use an if to select a username in particular, where should i give that parameter to the command?
My code for the login form is this:
Andrew McCormick
17,730 PointsAndrew McCormick
17,730 Pointsas a side note. Before you go any further, you might want to check out PDO