Advertisement
heru-kzw

forgot password

Dec 1st, 2016
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.55 KB | None | 0 0
  1. <?php
  2. if(isset($_POST["Request"])){
  3.     $usr=$_POST["email"];
  4.     $pas=$_POST["telephone"];
  5.    
  6.             if(cekCustomer($usr,$pas)<1){
  7.                 if(cekMember($usr,$pas)<1){
  8.                            
  9.                 session_destroy();
  10.                     echo "<script>alert('Otentikasi Cek Validasi GAGAL !,Silakan cek data Anda kembali...');
  11.                     document.location.href='index.php?mnu=forgot';</script>";
  12.                 }
  13.                 }
  14. }
  15.  
  16.  
  17.  
  18. function cekMember($usr,$pas){
  19.     $ada=0;
  20. $sa="select * from `tb_member` where `email`='$usr' and `telephone`='$pas' and `status`='Aktif'";
  21.                 $qa=mysql_query($sa);
  22.                 if(mysql_num_rows($qa)<1){
  23.                     $ada=0;
  24.                 }
  25.                 else{
  26.                     $ada=1;
  27.                     $da=mysql_fetch_array($qa);
  28.                     $username=$da["username"];
  29.                     $password=$da["password"];
  30.                    
  31.                     $nama=$da["nama_member"];
  32.                     echo "<script>alert('Yth $nama, Gunakan account dengan username: $username dan Password: $password untuk login !');
  33.                     document.location.href='index.php?mnu=home';</script>";
  34.                     }
  35.                     return $ada;
  36.     }
  37.    
  38.    
  39.  
  40. function cekCustomer($usr,$pas){
  41.     $ada=0;
  42. $sa="select * from `tb_customer` where `email`='$usr' and `telephone`='$pas' ";
  43.                 $qa=mysql_query($sa);
  44.                 if(mysql_num_rows($qa)<1){
  45.                     $ada=0;
  46.                 }
  47.                 else{
  48.                     $ada=1;
  49.                     $da=mysql_fetch_array($qa);
  50.                
  51.                     $nama=$da["nama_customer"];
  52.                     $username=$da["username"];
  53.                     $password=$da["password"];
  54.                     echo "<script>alert('Yth $nama, Gunakan account dengan username: $username dan Password: $password untuk login !');
  55.                     document.location.href='index.php?mnu=home';</script>";
  56.                     }
  57.                     return $ada;
  58.     }  
  59.    
  60.    
  61.    
  62.    
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement