Jump to content

Login System


claw2504

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");}

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...