Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    User permission..

    i got registration.php
    table:register
    fields:id,username,password,employee_role(3radio button,values 1 for admin 2 for mnager and 3 for employee..

    in the table for the employee_role(type:ENUM,values:'1','2','3'

    now how to insert these filed datas from php to mysql database???
    after successful registration..control shud come back to the login page..

    there by giving username and password it shud check whether he is a admin?manager?or employee and then take to their corresponding 3 different pages like admin.php,manager.php and employee.php
    how to implement this..


    please help me

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,686
    Thanks
    25
    Thanked 656 Times in 655 Posts
    Quote Originally Posted by danielbala View Post
    there by giving username and password it shud check whether he is a admin?manager?or employee and then take to their corresponding 3 different pages like admin.php,manager.php and employee.php
    how to implement this..
    You make your query. Check that the username and password from the DB is the same as the ones entered by the user. If they are you do IF statements on the employee_role. IF employee go to employee.php. IF admin go to admin.php. IF manager go to manager.php.


    Quote Originally Posted by danielbala View Post
    i got registration.php
    table:register
    fields:id,username,password,employee_role(3radio button,values 1 for admin 2 for mnager and 3 for employee..

    in the table for the employee_role(type:ENUM,values:'1','2','3'
    It's just my preference, but I'd use the words admin, manager, and employee instead of numbers. Easier to understand.

    Are you having trouble with the code? Post what you have and we'll look at it.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •