Advertisement
BedOmar

kode

Jul 16th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <style>
  2.     .nopass{
  3.     text-align: center;
  4.     position: fixed;
  5.     width: 270px;
  6.     height: 70px;
  7.     background: rgba(255, 0, 0, 0.4);
  8.     border: 2px solid black;
  9.     border-radius: 7px;
  10.     padding: 5px;
  11.     color: white;
  12.     right: 5px;
  13.     bottom: 5px;
  14.     }
  15.  
  16. </style>
  17. <?
  18.                 $email = $_POST['email'];
  19.                 $pass = $_POST['pass'];
  20.                
  21.                 if($_POST)
  22.                 {
  23.                     $success = 0;
  24.                     $count_id = file_get_contents('../register/count_id.dat');
  25.                     for($i=1; $i<$count_id; $i++)
  26.                     {
  27.                         $id = "id".$i;
  28.                         $email_acc = file_get_contents("../../acc/$id/info/email.dat");
  29.                         $pass_acc = file_get_contents("../../acc/$id/info/pass.dat");
  30.                         $nickname_acc = file_get_contents("../../acc/$id/info/nickname.dat");
  31.                        
  32.                         if($pass == $pass_acc and $email == $email_acc)
  33.                         {
  34.                            
  35.                             setcookie("id","$id", time() + 99999999, "/");
  36.                             setcookie("nickname","$nickname_acc", time() + 99999999, "/");
  37.                             $success = 1;
  38.                            
  39.                            
  40.                         }
  41.                     }
  42.                     if($success = 0)
  43.                     {
  44.                         echo
  45.                         '
  46.                             <script type="text/javascript">
  47.                                 setTimeout(function(){$(".nopass").fadeOut("fast")},10000);
  48.                             </script>
  49.                             <div class="nopass">
  50.                                 <h4>Неправильний логін або пароль!</h4>
  51.                             </div>
  52.                         ';
  53.                     }
  54.                     if($success = 1)
  55.                     {
  56.                         echo
  57.                         "
  58.                             ok
  59.                         ";
  60.                     }
  61.                 }
  62.  
  63.         if(isset($_COOKIE['id']))
  64.             {
  65.             echo
  66.             "
  67.                 Ви вже авторизовані
  68.             ";
  69.         }
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement