Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7174915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:09:53+00:00 2026-05-28T16:09:53+00:00

I have 3 radio buttons, labeled admin, manager and employee in registration.php. When the

  • 0

I have 3 radio buttons, labeled “admin”, “manager” and “employee” in registration.php.

When the new user selects a radio button, it should go to the DB.

When the username and password is given on the login page, it should take the user to the appropriate landing page according to the selected radio button:

  • admin goes to admin.php
  • manager goes to manager.php
  • employee goes to employee.php

What fields should be given for the 2 tables?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:09:54+00:00Added an answer on May 28, 2026 at 4:09 pm

    This is pretty much the same question as Joining tables in MySql with one common field but different values for the common field which you provided an answer on I see (though I didn’t read it and don’t know if it was correct).

    Basically just have ONE table called users with a column for “role” with the values 1-3, 1 being admin, 2 being manager and 3 for employee.

    When a user logs in, process the data to check if the password and username are correct which I believe you have already done. If so, check what “role” the user is and redirect them

    if($role == 1){
    // redirect to admin page
    }
    elseif($role == 2){
    // redirect to manager page
    }
    elseif($role == 3){
    // redirect to employee page
    }
    

    In response to your comments…
    I apologize as I’m not quite sure what you are asking.. But to retrieve the user’s “role” (admin, manager or employee) from the database use

    $getrole = mysql_query("SELECT role FROM table WHERE username = $username AND password = $password", $conn);
    $rowrole = mysql_fetch_assoc($getrole);
    $role = $rowrole['role'];
    

    Where $conn is your connection to the database, $username is the username entered into the login form and $password is the password entered into the login form. If either the username or password are incorrect then $role will return as a 0 and you can display an error message.

    You should have a default role such as employee because I assume there will be more employees than managers or admins, so go into phpMyAdmin and set the column “role” default to As Defined As 1. This means if a user registers and they do not select a role, it will assign them as employee by default. But you can validate this field and force them to select a role. Anyways…After retrieving the users role you find out what page to direct them to.

    if($role == 0){
    // show error message
    }
    elseif($role == 1){
    // redirect to admin page
    }
    elseif($role == 2){
    // redirect to manager page
    }
    elseif($role == 3){
    // redirect to employee page
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 radio buttons, what I want is if a user selects the
I have two radio buttons, in the same group name, users selects either one
I have 4 radio buttons.if i click on 1 radio button then 1 div
I have radio buttons in an application I am creating. When the user clicks
I have 3 radio buttons <input type=radio name=preferedpaymt value=CheckMailed id=CheckMailed1 <?php if($paymnt==CheckMail) {?> checked=checked
I have two radio buttons, one and two, if i click the radio button
I have 4 radio buttons in one group. Upon clicking the radio button the
I want to have radio buttons that tell my information where it should be
I have two radio buttons in frame1. On click on enable radio button, it
I have eight radio buttons on a user control. Each of them has or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.