Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PA1-1617-D3TI08
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
Dodi Agustin Refansius Pakpahan
PA1-1617-D3TI08
Commits
30bba4f3
Commit
30bba4f3
authored
May 16, 2017
by
Dodi Agustin Refansius Pakpahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Menambahkan fungsi login dan login proses
parent
28dddf56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
144 additions
and
0 deletions
+144
-0
login.php
login.php
+109
-0
login_proses.php
login_proses.php
+35
-0
No files found.
login.php
0 → 100644
View file @
30bba4f3
<?php
require_once
(
dirname
(
__FILE__
)
.
'/header.php'
);
session_start
();
?>
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"UTF-8"
/>
<link
rel=
"shortcut icon"
href=
"../favicon.ico"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/stylee.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/animate-custom.css"
/>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
BUKIT GIBEON
</title>
<link
rel=
"shortcut icon"
href=
"images/inst.png"
>
<link
href=
"css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
href=
"css/animate.css"
rel=
"stylesheet"
>
<link
href=
"css/myStyle.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/font-awesome.min.css"
>
<script
src=
"js/jquery-3.1.1.min.js"
></script>
<script
src=
"js/bootstrap.min.js"
></script>
</head>
<body
background=
"images/bg.jpg"
width=
"0px"
>
<body>
<div
class=
"containers"
>
<section>
<div
id=
"container_demo"
>
<a
class=
"hiddenanchor"
id=
"toregister"
></a>
<br><br><br><br><br><a
class=
"hiddenanchor"
id=
"tologin"
></a>
<div
id=
"wrapper"
>
<div
id=
"login"
class=
"animate form"
>
<form
action=
"login_proses.php"
autocomplete=
"on"
method=
"POST"
>
<h1>
Log in
</h1>
<p>
<label
for=
"username"
class=
"uname"
>
Your email or username
</label>
<input
id=
"username"
name=
"username"
type=
"text"
placeholder=
"enter username"
/>
</p>
<p>
<label
for=
"password"
class=
"youpasswd"
>
Your password
</label>
<input
id=
"password"
name=
"password"
type=
"password"
placeholder=
"masukkan passoword"
/>
</p>
<p
class=
"login button"
>
<input
type=
"submit"
value=
"Login"
/>
</p>
<p
class=
"change_link"
>
Not a member yet ?
<a
href=
"#toregister"
class=
"to_register"
>
Mendaftar
</a>
</p>
</form>
</div>
<div
id=
"register"
class=
"animate form"
>
<form
action=
"tambah_proses.php"
method=
"POST"
>
<h1>
Sign up
</h1>
<p>
<label
for=
"nama"
class=
"nama"
>
Nama Lengkap
</label>
<input
id=
"namalengkap"
name=
"namalengkap"
required=
"required"
type=
"text"
placeholder=
"Masukkan Nama Lengkap"
/>
</p>
<p>
<label
for=
"alamat"
class=
"alamat"
>
alamat
</label>
<input
id=
"alamat"
name=
"alamat"
required=
"required"
type=
"text"
placeholder=
"Masukkan alamat"
/>
</p>
<p>
<label
for=
"email"
class=
"email"
>
email
</label>
<input
id=
"email"
name=
"email"
required=
"required"
type=
"int"
placeholder=
"Masukkan email"
/>
</p>
<p>
<label
for=
"username"
class=
"uname"
>
Masukkan Username
</label>
<input
id=
"username"
name=
"username"
required=
"required"
type=
"text"
placeholder=
"Masukkan Username"
/>
</p>
<p>
<label
for=
"password"
class=
"youpasswd"
>
Masukkan password
</label>
<input
id=
"password"
name=
"password"
required=
"required"
type=
"password"
placeholder=
"Masukkan Password"
/>
</p>
<p
class=
"signin button"
>
<input
type=
"submit"
value=
"Daftar"
/>
</p>
<p
class=
"change_link"
>
Already a member ?
<a
href=
"#tologin"
class=
"to_register"
>
Go and log in
</a>
</p>
</form>
</div>
</div>
</div>
</section>
</div>
</body>
</html>
\ No newline at end of file
login_proses.php
0 → 100644
View file @
30bba4f3
<?php
session_start
();
require_once
(
'fungsi.php'
);
$username
=
$_POST
[
'username'
];
$password
=
$_POST
[
'password'
];
$query
=
"select * from user where username='"
.
$username
.
"' and password='"
.
$password
.
"'"
;
$sql
=
mysql_query
(
$query
);
$check
=
mysql_num_rows
(
$sql
);
$r
=
mysql_fetch_array
(
$sql
);
if
(
$check
>=
0
){
$_SESSION
[
'username'
]
=
$username
;
$_SESSION
[
'password'
]
=
$password
;
$_SESSION
[
'role'
]
=
$r
[
'role'
];
if
(
$r
[
'role'
]
==
'admin'
){
header
(
'LOCATION: home.php'
);
$_SESSION
[
'admin'
]
=
TRUE
;
}
elseif
(
$r
[
'role'
]
==
'user'
){
header
(
'LOCATION: index.php'
);
$_SESSION
[
'user'
]
=
TRUE
;
$_SESSION
[
'is_logged_in'
]
=
TRUE
;
$_SESSION
[
'username'
]
=
$username
;
}
elseif
(
$r
[
'username'
]
!=
$username
&&
$r
[
'password'
]
!=
$password
){
echo
"<script language='javascript'>alert('cek username dan Password anda')</script>"
;
echo
"<script>window.location = 'pengunjung.php'</script>"
;
}
}
?>
\ 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