...

View Full Version : User permission..



danielbala
01-22-2012, 08:32 AM
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

sunfighter
01-22-2012, 03:36 PM
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.



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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum