Advertisement
Guest User

Untitled

a guest
Apr 6th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. <?php
  2. include 'koneksi.php';
  3. if (isset($_POST['btnReset']))
  4. {
  5. $username = $_POST['username'];
  6. $cek = mysqli_query($koneksi,"select tiket from penumpang where username= '$username'");
  7. if(mysqli_num_rows($cek) == 1 )
  8. {
  9. $password = $_POST['password'];
  10. $repassword = $_POST['repassword'];
  11. if($password != $repassword)
  12. {
  13. ?>
  14. <script>
  15. alert("inputan password tidak sama");
  16. window.location.href = 'lupa.php';
  17. </script>
  18. <?php
  19. }else
  20. {
  21. $password = md5($password);
  22. $sql = mysqli_query($koneksi,"UPDATE penumpang SET password = '$password' WHERE username = '$username'");
  23. if($sql)
  24. {
  25. ?>
  26. <script>
  27. alert("Password telah di Perbarui");
  28. window.location.href = 'login.php';
  29. </script>
  30. <?php
  31. }else
  32. {
  33. ?>
  34. <script>
  35. alert("Password gagal di Perbarui");
  36. window.location.href = 'lupa.php';
  37. </script>
  38. <?php
  39. }
  40. }
  41. }else
  42. {
  43. ?>
  44. <script>
  45. alert("Pastikan username yang anda masukan Benar");
  46. window.location.href = 'lupa.php';
  47. </script>
  48. ?>php
  49. }
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement