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
71ba685f
Commit
71ba685f
authored
May 12, 2017
by
Mei Romauli Sagala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cek pendaftaran
parent
a43ea21e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
cek_daftar.php
cek_daftar.php
+53
-0
No files found.
cek_daftar.php
0 → 100644
View file @
71ba685f
<?php
include
(
'koneksi.php'
);
//menginisiasi variabel-variabel yang dikirimkan dari form-->input name
//fix problem : undefined index...
if
(
isset
(
$_POST
[
'name'
])
&&
isset
(
$_POST
[
'address'
])
&&
isset
(
$_POST
[
'phone'
])
&&
isset
(
$_POST
[
'email'
])
&&
isset
(
$_POST
[
'username'
])
&&
isset
(
$_POST
[
'password'
])
&&
isset
(
$_POST
[
'repass'
])
)
{
$nama
=
$_POST
[
'name'
];
$address
=
$_POST
[
'address'
];
$hp
=
$_POST
[
'phone'
];
$email
=
$_POST
[
'email'
];
$uname
=
$_POST
[
'username'
];
$pass
=
$_POST
[
'password'
];
$repass
=
$_POST
[
'repass'
];
}
else
{
//otomatis mengalihkan ke halaman pendaftaran jika terjadi undefined index
header
(
"location:form_daftar.php"
);
}
//jika user telah memasukkan semua data yang dibutuhkan, koreksi kata sandi
if
(
$pass
==
$repass
){
//mengambil informasi dari nama tabel "member" pada kolom "nama"
$ambilDataSql
=
mysql_query
(
"SELECT * FROM member WHERE username = '
$uname
'"
);
//mengambil informasi dari seluruh kolom nama
$cek_username
=
mysql_num_rows
(
$ambilDataSql
);
$ambilDataMember
=
mysql_query
(
"SELECT * FROM member"
);
$countData
=
mysql_num_rows
(
$ambilDataMember
);
//mengecek ketersediaan identitas
if
(
$cek_username
==
0
){
//jika nama tidak ditemukan/belum terdaftar
//lakukan penambahan data
$id
=
$countData
+
1
;
mysql_query
(
"INSERT INTO member VALUES(
$id
,'
$nama
','
$address
','
$hp
','
$uname
','
$pass
','
$email
')"
);
echo
"pendaftaran berhasil"
;
}
else
{
echo
"<h2> username pengguna sudah terdaftar. Silahkan ganti username anda</h2>"
;
echo
"<a href='form_daftar.php'>Kembali ke halaman pendaftaran</a>"
;
}
}
else
{
//jika kata sandi tidak sama
echo
"kata sandi tidak sama"
;
echo
"<a href='pendaftaran.php'>Kembali ke halaman pendaftaran</a>"
;
}
?>
\ 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