Commit 424a1f0d by Roy Junedi Simamora

perbaikan form daftar

parent 865fa461
<?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...
...@@ -36,17 +37,20 @@ ...@@ -36,17 +37,20 @@
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')"); mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO member VALUES('$id','$nama','$address','$hp','$uname','$pass','$email', '1')");
echo "<div class='alert'> <h2> Pendaftaran Berhasil </h2> </div>";
echo "pendaftaran berhasil"; 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 "<h2> username pengguna sudah terdaftar. Silahkan ganti username anda</h2>";
echo "<a href='form_daftar.php'>Kembali ke halaman pendaftaran</a>"; echo "<a href='form_daftar.php' class='btn btn-info'>Kembali ke halaman pendaftaran</a>";
} }
}else{ }else{
//jika kata sandi tidak sama //jika kata sandi tidak sama
echo "kata sandi tidak sama"; echo "<h2>Kata Sandi Tidak Cocok</h2>";
echo "<a href='pendaftaran.php'>Kembali ke halaman pendaftaran</a>"; echo "<a href='form_daftar.php' class='btn btn-info'>Kembali </a>";
} }
echo '<br/> <br/>';
include 'common/footer.php';
?> ?>
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
require_once(dirname(__FILE__).'/koneksi.php'); require_once(dirname(__FILE__).'/koneksi.php');
require_once(dirname(__FILE__).'/common/header.php'); require_once(dirname(__FILE__).'/common/header.php');
?> ?>
<br/>
<form class="well form-horizontal" action="cek_daftar.php" method="post" id="contact_form"> <form class="well form-horizontal" action="cek_daftar.php" method="post" id="contact_form">
<fieldset> <fieldset>
<legend>Member Registration</legend> <legend>Member Registration</legend>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment