Advertisement
BedOmar

kod

Jul 13th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.08 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js"></script>
  4.     <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
  5.     <title>
  6.         КОШТ
  7.     </title>
  8.     <link rel="stylesheet" href="../../styles.css">
  9.     <link rel="shortcut icon" href="../../img/icon.ico">
  10.     <link rel="stylesheet" href="../../css/admin_panel.css">
  11. </head>
  12. <style>
  13.     .nopass{
  14.     text-align: center;
  15.     position: fixed;
  16.     width: 270px;
  17.     height: 70px;
  18.     background: rgba(255, 0, 0, 0.4);
  19.     border: 2px solid black;
  20.     border-radius: 7px;
  21.     padding: 5px;
  22.     color: white;
  23.     right: 5px;
  24.     bottom: 5px;
  25.     }
  26.  
  27. </style>
  28. <body>
  29. <center>
  30.     <div class='all'>
  31.         <div class='top'>
  32.         <p class='shad'><a href='../../'><IMG style='float: left;' src='../../img/logo.png' align='middle' width='350' height='200'></a> KOSHT.COM.UA</p>
  33.         <p><font size='5' color='#87CEEB'>Клуб Обдарованих Школярів Тернополя</font></p>
  34.         <table align='center' width='100%'>
  35.             <tr>
  36.                 <td class='category'><a href='../../'>Головна</a></td>
  37.                 <td class='category'><a href='../../history'>Історія</a></td>
  38.                 <td class='category'><a href='.php'>Олімпіада</a></td>
  39.                 <td class='category'><a href='http://bedomar.comli.com/for/'>Форум</a></td>
  40.                 <td class='category'><a href='.php'>Контакти</a></td>
  41.                 <td class='category'><a href='.php'>Творчість</a></td>
  42.                 <td class='category'><a href='.php'>Опитування</a></td>
  43.                 <td class='category'><a href='.php'>Конкурси</a></td>
  44.             </tr>
  45.         </table>
  46.         </div>
  47.            
  48.         <div class='content'>  
  49.             <?
  50.                 $email = $_POST['email'];
  51.                 $pass = $_POST['pass'];
  52.                
  53.                 if($_POST)
  54.                 {
  55.                     $count_id = file_get_contents('../register/count_id.dat');
  56.                     for($i=1; $i<$count_id; $i++)
  57.                     {
  58.                         $id = "id".$i;
  59.                         $email_acc = file_get_contents("../../acc/$id/info/email.dat");
  60.                         $pass_acc = file_get_contents("../../acc/$id/info/pass.dat");
  61.                         $nickname_acc = file_get_contents("../../acc/$id/info/nickname.dat");
  62.                        
  63.                         if($pass == $pass_acc and $email == $email_acc)
  64.                         {
  65.                             setcookie("id","$id", time() + 99999999, "/");
  66.                             setcookie("nickname","$nickname_acc", time() + 99999999, "/");
  67.                             header( 'Location: ../../', true, 307 );
  68.                             break;
  69.                             echo "ok";
  70.                            
  71.                         }
  72.                         else
  73.                         {
  74.                             echo
  75.                             '
  76.                             <script type="text/javascript">
  77.                                 setTimeout(function(){$(".nopass").fadeOut("fast")},10000);
  78.                             </script>
  79.                             <div class="nopass">
  80.                                 <h4>Неправильний логін або пароль!</h4>
  81.                             </div>
  82.                             ';
  83.                         }
  84.                     }
  85.                 }
  86.                 if(!isset($_COOKIE['id']))
  87.                 {
  88.                     echo
  89.                     "
  90.                         <form action='index.php' method='post'>
  91.                             <input type='email' name='email'>
  92.                             <input type='password' name='pass'>
  93.                             <input type='submit'>
  94.                         </form>
  95.                     ";
  96.                 }
  97.                 if(isset($_COOKIE['id']))
  98.                 {
  99.                     echo
  100.                     "
  101.                         Ви вже авторизовані
  102.                     ";
  103.                 }
  104.             ?>
  105.         </div>
  106.     </div>
  107. <br><br>
  108.  
  109. </center>
  110.  
  111. </body>
  112. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement