Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PA1-1617-D3TI05
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fredrick Mangampu Theodorus Pardosi
PA1-1617-D3TI05
Commits
1afb50cc
Commit
1afb50cc
authored
May 13, 2017
by
Cici
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fungsi login dan logout
parent
d14c7912
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
login_process.php
login_process.php
+25
-0
logout.php
logout.php
+10
-0
No files found.
login_process.php
0 → 100644
View file @
1afb50cc
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
$username
=
$_POST
[
"username"
];
$password
=
$_POST
[
"password"
];
$res_set
=
mysqli_query
(
$database
,
"select * from user where username='
$username
' and password='
$password
'"
);
$res
=
mysqli_fetch_array
(
$res_set
);
if
(
$res_set
->
num_rows
<
1
)
{
redirect
(
'login.php'
);
$_SESSION
[
'error'
]
=
TRUE
;
}
else
{
set_session
(
'role'
,
$res
[
"role"
]);
set_session
(
'id'
,
$res
[
"id"
]);
set_session
(
'first_name'
,
$res
[
"first_name"
]);
// die(get_session('role'));
$_SESSION
[
'isLogin'
]
=
TRUE
;
// die(get_session('id'));
redirect
(
'index.php'
);
}
logout.php
0 → 100644
View file @
1afb50cc
<?php
session_start
();
include_once
'functions/fungsi.php'
;
include_once
'connection/koneksi.php'
;
destroy_session
(
"role"
);
destroy_session
(
"isLogin"
);
redirect
(
'index.php'
);
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment