Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
50% found this document useful (2 votes)
9K views

Creating Multi User Role Based Admin Using PHP Mysql and Bootstrap - Thesoftwareguy

php learn

Uploaded by

Arvind Mewada
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
9K views

Creating Multi User Role Based Admin Using PHP Mysql and Bootstrap - Thesoftwareguy

php learn

Uploaded by

Arvind Mewada
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

11/28/2015

TRENDING

YOU ARE AT:

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy
35 Important interview questions with answers for php freshers

Home

PHP

Search...

Creating multi user role based admin using php mysql and bootstrap

Creating multi user role based admin using php mysql and
bootstrap

40

ABOUT ME

Shahrukh Khan

BY Shahrukh Khan ON NOVEMBER 20, 2014

PHP

Entrepreneur & Dreamer


I am a passionate Software
Professional, love to learn and share
my knowledge with others.
Software is the hardware of my
life

GET MORE STUFF

IN YOUR
INBOX
Subscribe to our mailing list and get interesting
stuff and updates to your email inbox.

Enter your email here

Last two weeks I was quite busy with projects and hardly had any spare time left for writing blogs. I
had a huge backlog of mails requesting for tutorials. One thing I found common among them was
creating a multi user role based admin feature. I googled for the article so I can give them links but I
was not able to find useful tutorial. So i decided to make it myself for my readers. In this tutorial I will
be Creating multi user role based admin using php mysql and bootstrap library.

SIGN UP NOW
we respect your privacy and take protecting it
seriously

View Demo
Home is multi
PHP user

Jquery

What
role
based Snippet
admin?

Facebook

Ajax

Projects

Demos

Contact Me

For novice users let me explain what this article is all about. Suppose you have an online inventory store. You
have multiple employee each has their specific roles. i.e some person are responsible for feeding data (Data
Operator), some are responsible for customer support and some for sales. In this case you dont want all your
modules/data to be available to every one of them. So what you have to do is to assign a role to them, and
then they will have the privilege to access limited data only.
In this tutorial I am not going to make a full fledged admin panel. I will show the trick using mysql database and
php logic to create multi user admin. Follow the steps below.

Step 1. Create a database and add modules,system users, role and their rights.
The first step is to create a database. I have created a database named multi-admin. Create some modules
that you will be using in your application. Check the sample sql below.
2
3
4
5
6
7
8
9
10

CREATE DATABASE `multi-admin`


USE `multi-admin`

CREATE TABLE IF NOT EXISTS `module` (


`mod_modulegroupcode` varchar(25) NOT NULL,
`mod_modulegroupname` varchar(50) NOT NULL,
`mod_modulecode` varchar(25) NOT NULL,
`mod_modulename` varchar(50) NOT NULL,

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

1/11

11/28/2015
11
12
13
14
15
16

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy

`mod_modulegrouporder` int(3) NOT NULL,


`mod_moduleorder` int(3) NOT NULL,
`mod_modulepagename` varchar(255) NOT NULL,
PRIMARY KEY (`mod_modulegroupcode`,`mod_modulecode`),
UNIQUE(`mod_modulecode`)
) ENGINE=INNODB DEFAULT CHARSET=utf8

Once you have created modules table, feed some data into it. I have used purchases, sales, stocks and
Shipping, payment and taxes. So there are 6 modules in two groups.
2
3 INSERT INTO module (mod_modulegroupcode, mod_modulegroupname, mod_modulecode, mod_modulename,
mod_modulegrouporder, mod_moduleorder, mod_modulepagename) VALUES
4 ("INVT","Inventory", "PURCHASES","Purchases", 2, 1,'purchases.php'),
5 ("INVT","Inventory", "STOCKS","Stocks", 2, 2,'stocks.php'),
6 ("INVT","Inventory", "SALES","Sales", 2, 3,'sales.php'),
7 ("CHECKOUT","Checkout","SHIPPING","Shipping", 3, 1,'shipping.php'),
8 ("CHECKOUT","Checkout","PAYMENT","Payment", 3, 2,'payment.php'),
9 ("CHECKOUT","Checkout","TAX","Tax", 3, 3,'tax.php')

Create roles that will be assigned to the admins.


2
3
4
5
6
7
8
9
10
11

CREATE TABLE IF NOT EXISTS `role` (


`role_rolecode` varchar(50) NOT NULL,
`role_rolename` varchar(50) NOT NULL,
PRIMARY KEY (`role_rolecode`)
) ENGINE=INNODB DEFAULT CHARSET=utf8

INSERT INTO `role` (`role_rolecode`, `role_rolename`) VALUES


('SUPERADMIN', 'Super Admin'),
('ADMIN', 'Administrator')

Add system user/admin who will manage the application. Assign each admin with a role.
2
3
4
5
6
7
8
9
10
11
12
13
14

CREATE TABLE IF NOT EXISTS `system_users` (


`u_userid` int(11) AUTO_INCREMENTNOT NULL,
`u_username` varchar(100) NOT NULL,
`u_password` varchar(255) NOT NULL,
`u_rolecode` varchar(50) NOT NULL,
PRIMARY KEY (`u_userid`),
FOREIGN KEY (`u_rolecode`) REFERENCES `role` (`role_rolecode`)ON UPDATE CASCADE ON DELET
E RESTRICT
) ENGINE=INNODB DEFAULT CHARSET=utf8

INSERT INTO `system_users` (`u_username`, `u_password`, `u_rolecode`) VALUES


('shahrukh', '123456', 'SUPERADMIN'),
('ronaldo', 'ronaldo', 'ADMIN')

The final step is to give each role the privilege to access modules. I have used 4 options i.e create, edit, view
and delete.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

INSERT INTO `role_rights` (`rr_rolecode`, `rr_modulecode`, `rr_create`, `rr_edit`, `rr_delet


e`, `rr_view`) VALUES
('SUPERADMIN', 'PURCHASES', 'yes', 'yes', 'yes', 'yes'),
('SUPERADMIN', 'STOCKS', 'yes', 'yes', 'yes', 'yes'),
('SUPERADMIN', 'SALES', 'yes', 'yes', 'yes', 'yes'),
('SUPERADMIN', 'SHIPPING', 'yes', 'yes', 'yes', 'yes'),
('SUPERADMIN', 'PAYMENT', 'yes', 'yes', 'yes', 'yes'),
('SUPERADMIN', 'TAX', 'yes', 'yes', 'yes', 'yes'),

('ADMIN', 'PURCHASES', 'yes', 'yes', 'yes', 'yes'),


('ADMIN', 'STOCKS', 'no', 'no', 'no', 'yes'),
('ADMIN', 'SALES', 'no', 'no', 'no', 'no'),
('ADMIN', 'SHIPPING', 'yes', 'yes', 'yes', 'yes'),
('ADMIN', 'PAYMENT', 'no', 'no', 'no', 'yes'),
('ADMIN', 'TAX', 'no', 'no', 'no', 'no')

Step 2. Create files for every single modules.

POPULAR POST

RECENT POST

MAY 15, 2014

78

Upload multiple images create


thumbnails and save path to
database with php and mysql

NOVEMBER 24, 2013

56

Multiple dropdown with jquery ajax


and php

SEPTEMBER 16, 2014

46

Online Examination System

DECEMBER 10, 2013

41

How to create a simple dynamic


website with php and mysql

This step is very easy. You have to create files for each modules based on names you have given in the
database (module table). Apart from the 6 pages that are given the database, you have to create 3 more pages
viz. login.php (user will login), dashboard.php (user will see the menu/modules), and logout.php (to clear the

LIKE US ON FACEBOOK

session).

Step 3. Creating login form.


If you have followed my earlier tutorials, you should know that I use PDO classes to access the database. If you
are new to PDO classes try learning it from a sample mini-project Simple address book with php and mysql
using pdo.
2
3

<form class="form-horizontal" name="contact_form" id="contact_form" method="post" actio


n="">
4 <input type="hidden" name="mode" value="login" >
5
6 <fieldset>
7 <div class="form-group">
8 <label class="col-lg-2 control-label" for="username"><span class="requir
ed">*</span>Username:</label>
9 <div class="col-lg-6">
10 <input type="text" value="" placeholder="User Name" id="username" cl
ass="form-control" name="username" required="" >

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

2/11

11/28/2015
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy

</div>
</div>

<div class="form-group">
<label class="col-lg-2 control-label" for="user_password"><span class="r
equired">*</span>Password:</label>
<div class="col-lg-6">
<input type="password" value="" placeholder="Password" id="user_pass
word" class="form-control" name="user_password" required="" >
</div>
</div>

<div class="form-group">
<div class="col-lg-6 col-lg-offset-2">
<button class="btn btn-primary" type="submit">Submit</button>
</div>
</div>
</fieldset>
</form>

Create a file name config.php to set up basic configuration.


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

error_reporting( E_ALL &amp ~E_DEPRECATED &amp ~E_NOTICE )


ob_start()
session_start()

define('DB_DRIVER', 'mysql')
define('DB_SERVER', 'localhost')
define('DB_SERVER_USERNAME', 'root')
define('DB_SERVER_PASSWORD', '')
define('DB_DATABASE', 'multi-admin')

define('PROJECT_NAME', 'Create Multi admin using php mysql and bootstrap library')
$dboptions = array(
PDO::ATTR_PERSISTENT =&gt FALSE,
PDO::ATTR_DEFAULT_FETCH_MODE =&gt PDO::FETCH_ASSOC,
PDO::ATTR_ERRMODE =&gt PDO::ERRMODE_EXCEPTION,
PDO::MYSQL_ATTR_INIT_COMMAND =&gt 'SET NAMES utf8',
)

try {
$DB = new PDO(DB_DRIVER.':host='.DB_SERVER.'dbname='.DB_DATABASE, DB_SERVER_USERNAME, D
B_SERVER_PASSWORD , $dboptions)
} catch (Exception $ex) {
echo $ex-&gtgetMessage()
die
}

require_once 'functions.php'

//get error/success messages


if ($_SESSION["errorType"] != "" &amp&amp $_SESSION["errorMsg"] != "" ) {
$ERROR_TYPE = $_SESSION["errorType"]
$ERROR_MSG = $_SESSION["errorMsg"]
$_SESSION["errorType"] = ""
$_SESSION["errorMsg"] = ""
}

CATEGORIES
Achievements

(4)

Facebook

(8)

Interview

(1)

Jquery

(22)

Jquery / Javascript Snippet

(11)

Mini Projects

(5)

MySQL Snippet

(4)

PHP

(41)

PHP Snippet

(24)

PHP Tutorial

(6)

Premium Projects

(4)

Tips & Tricks

(9)

FOLLOW US ON TWITTER
Follow@thesoftwareguy7

124followers

Validating user login using PHP


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

$mode = $_REQUEST["mode"]
if ($mode == "login") {
$username = trim($_POST['username'])
$pass = trim($_POST['user_password'])

if ($username == "" || $pass == "") {

$_SESSION["errorType"] = "danger"
$_SESSION["errorMsg"] = "Enter manadatory fields"
} else {
$sql = "SELECT * FROM system_users WHERE u_username = :uname AND u_password = :upass
"

try {
$stmt = $DB->prepare($sql)

// bind the values


$stmt->bindValue(":uname", $username)
$stmt->bindValue(":upass", $pass)

// execute Query
$stmt->execute()
$results = $stmt->fetchAll()

if (count($results) > 0) {
$_SESSION["errorType"] = "success"
$_SESSION["errorMsg"] = "You have successfully logged in."

$_SESSION["user_id"] = $results[0]["u_userid"]
$_SESSION["rolecode"] = $results[0]["u_rolecode"]
$_SESSION["username"] = $results[0]["u_username"]

redirect("dashboard.php")
exit
} else {
$_SESSION["errorType"] = "info"

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

FIND US ON GOOGLE PLUS

thesoftwareguy7
Follow

+1

+ 4,052

3/11

11/28/2015
38
39
40
41
42
43
44
45
46
47
48

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy

$_SESSION["errorMsg"] = "username or password does not exist."


}
} catch (Exception $ex) {

$_SESSION["errorType"] = "danger"
$_SESSION["errorMsg"] = $ex->getMessage()
}
}
// redirect function is found in functions.php page
redirect("index.php")
}

Once you are logged in you are redirected to dashboard.php where you will see the menu/modules that are
assigned as per your role. Your role is saved in session when you are logged in.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

// if the rights are not set then add them in the current session
if (!isset($_SESSION["access"])) {

try {

$sql = "SELECT mod_modulegroupcode, mod_modulegroupname FROM module "


. " WHERE 1 GROUP BY `mod_modulegroupcode` "
. " ORDER BY `mod_modulegrouporder` ASC, `mod_moduleorder` ASC"

$stmt = $DB->prepare($sql)
$stmt->execute()
// modules group
$commonModules = $stmt->fetchAll()

$sql = "SELECT mod_modulegroupcode, mod_modulegroupname, mod_modulepagename,mod_mo


dulecode, mod_modulename FROM module "
. " WHERE 1 "
. " ORDER BY `mod_modulegrouporder` ASC, `mod_moduleorder` ASC"

$stmt = $DB->prepare($sql)
$stmt->execute()
// all modules
$allModules = $stmt->fetchAll()

$sql = "SELECT rr_modulecode, rr_create,rr_edit, rr_delete, rr_view FROM role_righ


ts "
. " WHERErr_rolecode = :rc "
. " ORDER BY `rr_modulecode` ASC"

$stmt = $DB->prepare($sql)
$stmt->bindValue(":rc", $_SESSION["rolecode"])

$stmt->execute()
// modules based on user role
$userRights = $stmt->fetchAll()

$_SESSION["access"] = set_rights($allModules, $userRights, $commonModules)

} catch (Exception $ex) {

echo $ex->getMessage()
}
}

In the above script all the data are passed into a function named set_rights() which return an array based on
user roles.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

function set_rights($menus, $menuRights, $topmenu) {


$data = array()

for ($i = 0, $c = count($menus) $i < $c $i++) {

$row = array()
for ($j = 0, $c2 = count($menuRights) $j < $c2 $j++) {
if ($menuRights[$j]["rr_modulecode"] == $menus[$i]["mod_modulecode"]) {
if (authorize($menuRights[$j]["rr_create"]) || authorize($menuRights[$j]["r
r_edit"]) ||
authorize($menuRights[$j]["rr_delete"]) || authorize($menuRights[$j]
["rr_view"])
) {

$row["menu"] = $menus[$i]["mod_modulegroupcode"]
$row["menu_name"] = $menus[$i]["mod_modulename"]
$row["page_name"] = $menus[$i]["mod_modulepagename"]
$row["create"] = $menuRights[$j]["rr_create"]
$row["edit"] = $menuRights[$j]["rr_edit"]
$row["delete"] = $menuRights[$j]["rr_delete"]
$row["view"] = $menuRights[$j]["rr_view"]

$data[$menus[$i]["mod_modulegroupcode"]][$menuRights[$j]["rr_modulecod
e"]] = $row
$data[$menus[$i]["mod_modulegroupcode"]]["top_menu_name"] = $menus[$i]
["mod_modulegroupname"]
}
}
}
}

return $data
}

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

4/11

11/28/2015
32
33
34
35
36

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy

// this function is used by set_rights() function


function authorize($module) {
return $module == "yes" ? TRUE : FALSE
}

Once you have all the modules based on your role in a session variable. Display it as list menu.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

<ul>
<?php foreach ($_SESSION["access"] as $key => $access) { ?>
<li>
<?php echo $access["top_menu_name"] ?>
<?php
echo '<ul>'
foreach ($access as $k => $val) {
if ($k != "top_menu_name") {
echo '<li><a href="' . ($val["page_name"]) . '">' . $val["me
nu_name"] . '</a></li>'
?>
<?php
}
}
echo '</ul>'
?>
</li>
<?php
}
?>
</ul>

Step 4. Conditional checking for each modules functionality.


In this step you have to manually check write a security check for a module functionaliy. Let say user has the
right to create, edit and view purchases but not delete it. In this case you have to add a conditional checking
before each buttons/links. See a sample below for purchases.php page module.
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

<!-- for creating purchase function -->


<?php if (authorize($_SESSION["access"]["INVT"]["PURCHASES"]["create"])) { ?>
<button class="btn btn-sm btn-primary" type="button"><i class="fa fa-plus"></i> ADD PURCHAS
E</button>
<?php } ?>

<!-- for updating purchase function -->


<?php if (authorize($_SESSION["access"]["INVT"]["PURCHASES"]["edit"])) { ?>
<button class="btn btn-sm btn-info" type="button"><i class="fa fa-edit"></i> EDIT</button>
<?php } ?>

<!-- for view purchase function -->


<?php if (authorize($_SESSION["access"]["INVT"]["PURCHASES"]["view"])) { ?>
<button class="btn btn-sm btn-warning" type="button"><i class="fa fa-search-plus"></i> VIE
W</button>
<?php } ?>

<!-- for delete purchase function -->


<?php if (authorize($_SESSION["access"]["INVT"]["PURCHASES"]["delete"])) { ?>
<button class="btn btn-sm btn-danger" type="button"><i class="fa fa-trash-o"></i> DELETE</bu
tton>
<?php } ?>

Step 5. Validation for logged in and non-logged in user.


Another security checking, you can add this checking for individual page. check the two test cases below.
If user is logged in and trying to access login page. User will be redirected to dashboard.
If user is not logged in and trying to access any page expect login page. User will be redirected to login
page.
2
3
4
5
6
7
8
9
10
11
12
13

// paste this in login page


if (isset($_SESSION["user_id"]) && $_SESSION["user_id"] != "") {
// if logged in send to dashboard page
redirect("dashboard.php")
}

// paste this in any page which require admin authorization


if (!isset($_SESSION["user_id"]) || $_SESSION["user_id"] == "") {
// not logged in send to login page
redirect("index.php")
}

You can also add another layer ofsecurity check for each modules pages if you want. In case if user is trying to
access a modules using direct page URL but is not assigned for, they must not passed this security check.
2
3
4
5
6
7
8
9
10
11
12

$status = FALSE
if ( authorize($_SESSION["access"]["INVT"]["PURCHASES"]["create"]) ||
authorize($_SESSION["access"]["INVT"]["PURCHASES"]["edit"]) ||
authorize($_SESSION["access"]["INVT"]["PURCHASES"]["view"]) ||
authorize($_SESSION["access"]["INVT"]["PURCHASES"]["delete"]) ) {
$status = TRUE
}

if ($status === FALSE) {


die("You dont have the permission to access this page")

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

5/11

11/28/2015

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy

13 }

Step 6. Logout Page.


The step is just for clearing the session and redirecting user back to login page.
2
3
4
5
6
7
8

session_start()
$_SESSION = array()
unset($_SESSION)
session_destroy()
header("location:index.php")
exit

View Demo

Thedownloadlinkislocked!
Wedon'tneedmoneyfromyou,justuseoneofthebuttonsbelowtoappreciateourworkand
unlockthecontent.
Tweet tweet

Like

5.4k
likeus

PREVIOUS ARTICLE

Concat columns with separators in mysql

4k+1us

NEXT ARTICLE

notice undefined index error in php

ABOUT AUTHOR

Shahrukh Khan

Entrepreneur & Dreamer

I am a passionate Software Professional, love to learn and share my knowledge with others.
Software is the hardware of my life.

RELATED POSTS

MARCH 25, 2015

Encode and Decode query string


value in php

FEBRUARY 15, 2015

Calculating difference between


two dates in php

JANUARY 14, 2015

19

Send email from


localhost/online server using
php

40 COMMENTS

Kapil Verma on November 21, 2014 6:58 Am


Download link going to localhost. Please update it.
REPLY

Shahrukh Khan on November 21, 2014 2:36 Pm


Thanks. I have updated it.
REPLY

Nikita Shrivastava on November 23, 2014 6:29 Pm


Thank you so much..!! I actually needed some help to overcome this problem. Thanks again.

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

6/11

11/28/2015

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy
REPLY

Shahrukh Khan on November 26, 2014 3:45 Pm


Yes what help you need?
REPLY

Tanjina on November 25, 2014 4:39 Am


good job bro.
REPLY

Shahrukh Khan on November 26, 2014 3:45 Pm


Thank You Tanjina.
REPLY

Prabakarab on January 16, 2015 8:06 Am


this is what i am looking for.
thank you so much for sharing
REPLY

Shahrukh Khan on January 16, 2015 2:58 Pm


Thanks a lot
REPLY

Prabakar on February 20, 2015 9:22 Am


hi sharuk,
can u please tell me how to build this application in codeigniter.?
thanks
REPLY

Shahrukh Khan on February 24, 2015 8:03 Am


All the concept is same, for the database part make a model, use the application logic in the
controller and for output the rights/menu in the view file.
REPLY

Ashok on March 12, 2015 6:23 Am


hi sharuk,
good job man.
REPLY

Shahrukh Khan on March 13, 2015 4:31 Pm


Thanks a lot.
REPLY

Prabakar on March 20, 2015 1:28 Pm


Hi sharuk
if we use OR opertor in In Page level security check , will it retrieve all data?
so we can access below operations right?
create, edit, delete, view.
Please explain
REPLY

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

7/11

11/28/2015

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy
REPLY

Shahrukh Khan on March 25, 2015 10:15 Am


yes it will
REPLY

Arsalan on March 26, 2015 1:31 Pm


Dear what is the structure of last table/???
REPLY

Suman Chhetri on April 11, 2015 3:11 Pm


I downloaded the contents and configured database as instructed but when Im logging in as Ronald , no
option is available. When I login through Shahrukh, only then menu options are visible. Need your
assistance.
REPLY

Shahrukh Khan on April 12, 2015 10:51 Am


you have to give rights for ronald.
REPLY

Henry on April 29, 2015 8:22 Am


Thank you for the tutorial, i have followed every step but i am not able to login, also does alidating user
login using PHP code go into the config file..
I am just a step away to getting this Kindly help
REPLY

Shahrukh Khan on April 30, 2015 10:33 Am


make sure you have given the access right for the user.
REPLY

Ask on May 14, 2015 10:54 Pm


Hi there, always i used to check weblog posts here in the early hours in the morning, for the reason that i
enjoy to learn more and more.
REPLY

Umer on May 16, 2015 6:09 Pm


Not able to download any code
REPLY

Shahrukh Khan on May 17, 2015 7:04 Am


Please click in the social link to unlock the download link
REPLY

Harinath on May 18, 2015 7:33 Am


HI Shahrukh,
i am developing a wordpress website with huge data with lots of images ..
if i want to change the website look ..i will upload that whole data again one by one which takes lots of
time.
is there any way to insert bulk data at a time??
please help me

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

8/11

11/28/2015

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy
Thanks in advance.
REPLY

Newbee on June 22, 2015 5:07 Am


sir, can u make 1 register form for this login scripts,
thx before for this great scripts
REPLY

Shahrukh Khan on June 22, 2015 7:13 Am


check this tutorial. hope this will help you.
http://www.thesoftwareguy.in/creating-responsive-multi-step-form-bootstrap-jquery/
REPLY

Sanjay on July 5, 2015 8:28 Am


useful and very nice
REPLY

Jose Rivera on July 15, 2015 5:25 Pm


What happen if you want to create multilevel menu with modules, now you only allow one sub level
It will be something like this : Banking -> Accounts -> Others
REPLY

Shahrukh Khan on July 21, 2015 10:13 Am


In that case you can go for a parent-child relationship way using a column say parent that will
hold the ID of the parent menu.
REPLY

Tony on July 29, 2015 3:45 Pm


Hi
Trying to set this up but I am struggling.
Can you show the sql code to create the role_rights table.
I cant see the function redirect that should be in the functions php
Could you assist
Thank you
REPLY

Shahrukh Khan on August 5, 2015 10:27 Am


check step 1 of the article.
REPLY

Michael on July 31, 2015 8:17 Pm


I cant thank you enough! Great tutorial
REPLY

Pallab on August 30, 2015 5:35 Am


Very Nice would u plz explain module order section in database part
REPLY

Shahrukh Khan on September 9, 2015 5:28 Pm

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

9/11

11/28/2015

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy
everything is already explained, what part are you facing problem.
REPLY

Sonia on September 5, 2015 7:12 Am


helloi am not able to get the moduleorder and modulegrouporder could you please explain how its
working?
REPLY

Jack on September 7, 2015 6:56 Am


The role_rights table is unavailable. Kindly share it with me
REPLY

Shahrukh Khan on September 9, 2015 5:27 Pm


it is there, please check.
REPLY

Alex Yeung on September 15, 2015 2:27 Pm


I cant get the download link even I like it.
REPLY

Shahrukh Khan on September 28, 2015 4:43 Am


double click on that like button.
REPLY

Alvaro on November 18, 2015 9:46 Am


Thank you for this amazing tutorial!
I would like to ask if its possible to do the same but instead with a website, using android! So far Ive
already created the database and I am capable to insert and modify values, but Im not sure how I would
relate the roles depending of the user thanks!
REPLY

Shahrukh Khan on November 20, 2015 5:59 Am


well I am not into Android. but I am sure you have to use the logic the same way given here.
REPLY

LEAVE A REPLY

Your Name

Your Email

Your Website

Your Comment

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

10/11

11/28/2015

Creatingmultiuserrolebasedadminusingphpmysqlandbootstrapthesoftwareguy

Post Comment

Confirm you are NOT a spammer

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Copyright 2013 - 2015 www.thesoftwareguy.in All Rights Reserved.


www.thesoftwareguy.in by Shahrukh Khan is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

http://www.thesoftwareguy.in/creatingmultiuserrolebasedadminusingphpmysqlbootstrap/#prettyPhoto

11/11

You might also like