Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
RestoranPondokEdo
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
Mei Romauli Sagala
RestoranPondokEdo
Commits
8c354753
Commit
8c354753
authored
May 24, 2017
by
Roy Junedi Simamora
Browse files
Options
Browse Files
Download
Plain Diff
progress
parents
3d062ca0
16cb3164
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
70 deletions
+39
-70
form_login.php
form_login.php
+39
-70
No files found.
form_login.php
View file @
8c354753
...
...
@@ -2,74 +2,42 @@
require_once
(
dirname
(
__FILE__
)
.
'/common/header.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/cek_login.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/fungsi/session.php'
);
global
$con
;
$con
=
mysqli_connect
(
"localhost"
,
"p1d3ti04"
,
"p1d3ti04"
,
"MeiHong05"
);
if
(
!
$con
)
{
die
(
"database connect problem"
);
}
$db_use
=
mysqli_select_db
(
$con
,
"p1d3ti04_pondokedo"
)
or
die
(
"selet db problem !!"
);
if
(
isset
(
$_GET
[
'do_login'
])){
$login
=
getUser
(
$_POST
[
'username'
],
$_POST
[
'password'
]);
if
(
$login
==
false
){
$_SESSION
[
'login_error'
]
=
TRUE
;
}
else
{
$_SESSION
[
'user'
]
=
TRUE
;
$row
=
mysqli_fetch_array
(
$login
);
$_SESSION
[
'username'
]
=
$row
[
'username'
];
$_SESSION
[
'id_member'
]
=
$row
[
'id_member'
];
$_SESSION
[
'user'
]
=
TRUE
;
header
(
"location:index.php"
);
}
$log
=
getAdmin
(
$_POST
[
'username'
],
$_POST
[
'password'
]);
if
(
$log
==
false
){
$_SESSION
[
'login_error'
]
=
TRUE
;
}
else
{
$resAdm
=
mysqli_fetch_array
(
$log
);
$_SESSION
[
'admin'
]
=
TRUE
;
header
(
"location:admin_menu.php"
);
}
if
(
isset
(
$_SESSION
[
"login_error"
])){
echo
"<script> window.alert('Login Gagal !! Username dan Password Salah !!')</script>"
;
}
}
?>
<br/>
<form
class=
'well form-horizontal'
action=
'form_login.php?do_login=1'
method=
'post'
id=
'contact_form'
>
<fieldset>
<legend><span
class=
'glyphicon glyphicon-log-in'
></span>
Login
</legend>
<div
class=
'form-group'
>
<label
class=
'col-md-4 control-label'
>
Username
</label>
<div
class=
'col-md-4 inputGroupContainer'
>
<div
class=
'input-group'
>
<span
class=
'input-group-addon'
><i
class=
'glyphicon glyphicon-user'
></i></span>
<input
type=
'text'
name=
'username'
required
placeholder=
'Username'
class=
'form-control'
type=
'text'
>
</div>
</div>
</div>
<div
class=
'form-group'
>
<label
class=
'col-md-4 control-label'
>
Password
</label>
<div
class=
'col-md-4 inputGroupContainer'
>
<div
class=
'input-group'
>
<span
class=
'input-group-addon'
><i
class=
'glyphicon glyphicon-lock'
></i></span>
<input
name=
'password'
required
placeholder=
'Password'
class=
'form-control'
type=
'password'
>
</div>
</div>
</div>
<div
class=
'form-group'
>
<label
class=
'col-md-4 control-label'
></label>
<div
class=
'col-md-4'
>
<input
type=
'submit'
value=
'login'
class=
'btn btn-default'
>
</div>
</div>
<center>
Belum punya akun?
<a
href=
'form_daftar.php'
>
silahkan daftar disini
</center>
</fieldset>
</form>
<?php
require_once
(
dirname
(
__FILE__
)
.
'/common/footer.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/fungsi/session.php'
);
?>
<br/>
<form
class=
'well form-horizontal'
action=
'form_login.php?do_login=1'
method=
'post'
id=
'contact_form'
>
<fieldset>
<legend><span
class=
'glyphicon glyphicon-log-in'
></span>
Login
</legend>
<div
class=
'form-group'
>
<label
class=
'col-md-4 control-label'
>
Username
</label>
<div
class=
'col-md-4 inputGroupContainer'
>
<div
class=
'input-group'
>
<span
class=
'input-group-addon'
><i
class=
'glyphicon glyphicon-user'
></i></span>
<input
type=
'text'
name=
'username'
required
placeholder=
'Username'
class=
'form-control'
type=
'text'
>
</div>
</div>
</div>
<div
class=
'form-group'
>
<label
class=
'col-md-4 control-label'
>
Password
</label>
<div
class=
'col-md-4 inputGroupContainer'
>
<div
class=
'input-group'
>
<span
class=
'input-group-addon'
><i
class=
'glyphicon glyphicon-lock'
></i></span>
<input
name=
'password'
required
placeholder=
'Password'
class=
'form-control'
type=
'password'
>
</div>
</div>
</div>
<div
class=
'form-group'
>
<label
class=
'col-md-4 control-label'
></label>
<div
class=
'col-md-4'
>
<input
type=
'submit'
value=
'login'
class=
'btn btn-default'
>
</div>
</div>
<center>
Belum punya akun?
<a
href=
'form_daftar.php'
>
silahkan daftar disini
</center>
</fieldset>
</form>
<?php
require_once
(
dirname
(
__FILE__
)
.
'/common/footer.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