Jump to content

Login System


claw2504
 Share

Recommended Posts

Morning guys,My website is almost complete (with some much appreciated help) now, with the exception of a login system. I need to create one that allows a user to enter there details on a log in page and then, depending on the username entered, have it redirect them to a specifc page.Is this possible and can anyone point me in the right direction.

Link to comment
Share on other sites

Yes it is possible. At the login page you have check for the username using a IF statement, then use the header to redirect them to the correct page. Usually, if you are doing a lot of this, you want to use user levels, and redirect them using their user level.

if ($user == "Sam") {  header("location:SamPage.php");}if ($user == "John") {  header("loocation:JohnPage.php");}

Edited by RahXephon
Link to comment
Share on other sites

I just reread the question. You also need a login system. You can use this login system for now. It has deprecated code in it, but will get you started and help you understand the basics on how a login system works. If anyone has a better example, then by all means.Login systems use sessions to keep track of who is logged in. It is accompined by a database, which has the usernames and passwords of members. A login system checks the data inputed by the user and compares it to the data in the database. If it matches, a session is set.PHP Sessions

Edited by RahXephon
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...