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
3d062ca0
Commit
3d062ca0
authored
May 24, 2017
by
Roy Junedi Simamora
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
progress
parent
0afb7515
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
20 deletions
+21
-20
cek_daftar.php
cek_daftar.php
+8
-12
cek_login.php
cek_login.php
+1
-1
form_login.php
form_login.php
+9
-4
koneksi.php
koneksi.php
+3
-3
No files found.
cek_daftar.php
View file @
3d062ca0
<?php
<?php
include
(
'koneksi.php'
);
include
(
'koneksi.php'
);
include
'common/header.php'
;
//menginisiasi variabel-variabel yang dikirimkan dari form-->input name
//menginisiasi variabel-variabel yang dikirimkan dari form-->input name
//fix problem : undefined index...
//fix problem : undefined index...
...
@@ -37,20 +36,16 @@
...
@@ -37,20 +36,16 @@
if
(
$cek_username
==
0
){
//jika nama tidak ditemukan/belum terdaftar
if
(
$cek_username
==
0
){
//jika nama tidak ditemukan/belum terdaftar
//lakukan penambahan data
//lakukan penambahan data
$id
=
$countData
+
1
;
$id
=
$countData
+
1
;
mysqli_query
(
$GLOBALS
[
"___mysqli_ston"
],
"INSERT INTO member VALUES('
$id
','
$nama
','
$address
','
$hp
','
$uname
','
$pass
','
$email
', '1')"
);
echo
(
"<script> alert('Pendaftaran berhasil')</script>"
);
echo
"<div class='alert'> <h2> Pendaftaran Berhasil </h2> </div>"
;
echo
"<meta http-equiv='refresh' content='1 url=form_daftar.php'>"
;
echo
"<a href='form_daftar.php' class='btn btn-primary'> <span class='glyphicon glyphicon-chevron-left'></span> Kembali </a>"
;
}
else
{
}
else
{
echo
"<h2> username pengguna sudah terdaftar. Silahkan ganti username anda</h2>"
;
echo
(
"<script> alert('Username sudah terdaftar , silahkan ganti username anda')</script>"
)
;
echo
"<
a href='form_daftar.php' class='btn btn-info'>Kembali ke halaman pendaftaran</a
>"
;
echo
"<
meta http-equiv='refresh' content='1 url=form_daftar.php'
>"
;
}
}
}
else
{
}
else
{
//jika kata sandi tidak sama
//jika kata sandi tidak sama
echo
"<h2>Kata Sandi Tidak Cocok</h2>"
;
echo
(
"<script> alert('katasandi tidak sama')</script>"
)
;
echo
"<a href='form_daftar.php' class='btn btn-info'>Kembali </a
>"
;
echo
"<meta http-equiv='refresh' content='1 url=form_daftar.php'
>"
;
}
}
echo
'<br/> <br/>'
;
include
'common/footer.php'
;
?>
?>
\ No newline at end of file
cek_login.php
View file @
3d062ca0
<?php
<?php
global
$con
;
global
$con
;
$con
=
mysqli_connect
(
"localhost"
,
"
root"
,
"
"
);
$con
=
mysqli_connect
(
"localhost"
,
"
p1d3ti04_pondokedo"
,
"MeiHong05
"
);
if
(
!
$con
)
{
if
(
!
$con
)
{
die
(
"database connect problem"
);
die
(
"database connect problem"
);
}
}
...
...
form_login.php
View file @
3d062ca0
...
@@ -4,13 +4,20 @@ require_once(dirname(__FILE__).'/common/header.php');
...
@@ -4,13 +4,20 @@ require_once(dirname(__FILE__).'/common/header.php');
require_once
(
dirname
(
__FILE__
)
.
'/cek_login.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/cek_login.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/fungsi/session.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'
])){
if
(
isset
(
$_GET
[
'do_login'
])){
$login
=
getUser
(
$_POST
[
'username'
],
$_POST
[
'password'
]);
$login
=
getUser
(
$_POST
[
'username'
],
$_POST
[
'password'
]);
if
(
$login
==
false
){
if
(
$login
==
false
){
$_SESSION
[
'login_error'
]
=
TRUE
;
$_SESSION
[
'login_error'
]
=
TRUE
;
}
else
{
}
else
{
$_SESSION
[
'user'
]
=
TRUE
;
$_SESSION
[
'user'
]
=
TRUE
;
$row
=
mysqli_fetch_a
ssoc
(
$login
);
$row
=
mysqli_fetch_a
rray
(
$login
);
$_SESSION
[
'username'
]
=
$row
[
'username'
];
$_SESSION
[
'username'
]
=
$row
[
'username'
];
$_SESSION
[
'id_member'
]
=
$row
[
'id_member'
];
$_SESSION
[
'id_member'
]
=
$row
[
'id_member'
];
$_SESSION
[
'user'
]
=
TRUE
;
$_SESSION
[
'user'
]
=
TRUE
;
...
@@ -21,8 +28,6 @@ if(isset($_GET['do_login'])){
...
@@ -21,8 +28,6 @@ if(isset($_GET['do_login'])){
$_SESSION
[
'login_error'
]
=
TRUE
;
$_SESSION
[
'login_error'
]
=
TRUE
;
}
else
{
}
else
{
$resAdm
=
mysqli_fetch_array
(
$log
);
$resAdm
=
mysqli_fetch_array
(
$log
);
set_session
(
'id'
,
$resAdm
[
'id_admin'
]);
set_session
(
'nama'
,
$resAdm
[
'nama'
]);
$_SESSION
[
'admin'
]
=
TRUE
;
$_SESSION
[
'admin'
]
=
TRUE
;
header
(
"location:admin_menu.php"
);
header
(
"location:admin_menu.php"
);
}
}
...
...
koneksi.php
View file @
3d062ca0
<?php
<?php
$host
=
"127.0.0.1"
;
$host
=
"127.0.0.1"
;
$user
=
"
root
"
;
$user
=
"
p1d3ti04
"
;
$pass
=
""
;
$pass
=
"
MeiHong05
"
;
$name
=
"p1d3ti04_pondokedo"
;
$name
=
"p1d3ti04_pondok
_
edo"
;
$koneksi
=
(
$GLOBALS
[
"___mysqli_ston"
]
=
mysqli_connect
(
$host
,
$user
,
$pass
,
$name
))
or
die
(
"Koneksi ke database gagal!"
);
$koneksi
=
(
$GLOBALS
[
"___mysqli_ston"
]
=
mysqli_connect
(
$host
,
$user
,
$pass
,
$name
))
or
die
(
"Koneksi ke database gagal!"
);
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