I was working on a script before taking ill. I need urgent help with this.

I have login form, and I can use http://phpeasystep.com login tutorial to do a single user login. But I need it for like 4 different users redirecting to diffrent pages after login/

The form code:

<form action="checklogin.php" method="POST" name="logForm">
  <legend>Please Login Here!</legend>
    <label for="name">Username:</label>
    <input type="text" name="username" id="username" />
    <br /> <br /> <br />
    <label for="password">Password:</label>
    <input type="password" name="password" id="password" />
    <br /> <br /> <br />
    <label for="address">User Type:</label>
    <select name="subtype" id="subtype">
        <option value="" selected="selected">Select Type..</option>
        <option value="1">User1</option>
        <option value="Nurse">User2</option>
        <option value="Accountant">User3</option>
        <option value="Lab Tech">User4</option>
    <br /> <br /> <br />
    <label for="submit">&nbsp;</label>
    <input type="image" name="submit" src="images/login_button.png" />

I have a database with, username, password and subtype

Ehh? I'm guessing you know the names of these users?

I would use sessions:


      // if sucsessfully signed in
      $_SESSION['username'] = $username;

         case 'bob':
         // redirect for bob

         case 'harry':
         // redirect for harry

          // default redirect
Member Avatar


I believe that we've advised you before about the wisdom of providing a dropdown in the login form. The form should redirect automatically on successful login since the DB stores the subtype so you can retrieve it and send them to the right page. SHould be simple.