Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2013
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.73 KB | None | 0 0
  1. <?php
  2. include("config.inc");
  3. ?>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
  5. <link href="./css/style.css" type="text/css" rel="stylesheet" />
  6.   <title><?php echo $server_name; ?></title>
  7.  
  8. <div id="logo"></div>
  9. <div id="bg">
  10. <div id="form">
  11. <form action="index.php" method="POST">
  12. <table>
  13. <tr>
  14. <td><div id="p1"><p>Jmeno:</p></td>
  15. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  16.     <td>
  17.       <input type="text" name="acc">
  18.     </td>
  19. </tr>
  20.  
  21. <tr>
  22. <td><div id="p2"><p>Heslo:</p></td>
  23. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  24.     <td>
  25.       <input type="text" name="pass">
  26.     </td>
  27. </tr>
  28.  
  29. <div class="styled-select">
  30.  
  31. <tr>
  32. <td>
  33. <div id="p3"><p>Server:</p></td>
  34. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
  35.   <td>
  36.  
  37.     <select name="server">
  38. <?php
  39.   $option = mysql_query("SELECT * FROM Realmlist");
  40.       while ($data = mysql_fetch_assoc($option))
  41.       {    
  42.             echo "<option value='{$data['id']}'>{$data['name']}</option>";
  43.       }
  44. ?>
  45.     </select>
  46.    
  47.   </td>
  48. </tr>
  49.  
  50. </div>
  51. <tr>
  52. <td></td>
  53. <td></td>
  54.   <td>
  55.     <input type="submit" value="Přihlásit se" name="submit">
  56.   </td>
  57. </tr>
  58.  
  59. </table>
  60. </form>
  61. </div></div>
  62.   <div id="footer"><b><?php echo $footer; ?></b></div>
  63. <?php
  64.  
  65. //Jmeno Acc
  66. $acc = $_POST["acc"];
  67.  
  68. //Pass Acc
  69. $pass = $_POST["pass"];
  70.  
  71. //Pass Acc
  72. $password = $_POST["pass"];
  73.  
  74. //Zjistěni IP
  75. $ip_log = $_SERVER["REMOTE_ADDR"];
  76.  
  77. //Datum
  78. $date = date("d.m.Y v H:i:s");
  79.  
  80.  
  81. //Overeni jmena a hesla
  82.  
  83. if($acc != ""){
  84. if($pass != ""){
  85.  
  86.         $query = mysql_query("SELECT * FROM account_manager WHERE username='{$acc}' AND password='{$password}'");
  87.         $row = mysql_num_rows($query);
  88.         if($row == 1){
  89.             session_start();
  90.                   $a=mysql_fetch_array($query);
  91.                   $_SESSION['user']=$a['username'];
  92.                   $_SESSION['id']=$a['id'];
  93.              
  94.           echo "<div id='success'><br><center>Za 3s Budeš Přihlášen</center></div>";
  95.        
  96.             echo "<meta http-equiv='refresh' content='3;url=./login/index.php'>";
  97.            
  98.                   mysql_query("INSERT INTO login_log VALUES ('', '$acc', '<font color='green'>Souhlasí</font>', '$ip_log', '$date')");
  99.            
  100.         }
  101.         else{
  102.        
  103.           echo "<div id='error'><br><center>Špatné Jméno nebo Heslo</center></div>";
  104.          
  105.                   mysql_query("INSERT INTO login_log VALUES ('', '$acc', '<font color='red'>$pass</font>', '$ip_log', '$date')");  
  106.         }
  107. }
  108.     else{
  109.           echo "<div id='error'><br><center>Jméno, Heslo je Poviné</center></div>";
  110.     }
  111.  
  112. }    
  113.     else{
  114.           echo "<div id='error'><br><center>Jméno, Heslo je Poviné</center></div>";
  115.     }
  116. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement