Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'koneksi.php';
- if (isset($_POST['btnReset']))
- {
- $username = $_POST['username'];
- $cek = mysqli_query($koneksi,"select tiket from penumpang where username= '$username'");
- if(mysqli_num_rows($cek) == 1 )
- {
- $password = $_POST['password'];
- $repassword = $_POST['repassword'];
- if($password != $repassword)
- {
- ?>
- <script>
- alert("inputan password tidak sama");
- window.location.href = 'lupa.php';
- </script>
- <?php
- } else {
- $password = md5($password);
- $sql = mysqli_query($koneksi,"UPDATE penumpang SET password = '$password' WHERE username = '$username'");
- if($sql)
- {
- ?>
- <script>
- alert("Password telah di Perbarui");
- window.location.href = 'login.php';
- </script>
- <?php
- } else {
- ?>
- <script>
- alert("Password gagal di Perbarui");
- window.location.href = 'lupa.php';
- </script>
- <?php
- }
- }
- } else {
- ?>
- <script>
- alert("Pastikan username yang anda masukan Benar");
- window.location.href = 'lupa.php';
- </script>
- <?php
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement