Guest User

Untitled

a guest
Nov 10th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <div style="height:100%;width:50%;" class='left'>
  2. <form action="" method="POST">
  3. <input class='username' type='text' name='username'><br>
  4. <input class='pw' type='password' name='password'><br>
  5. <input class='submit' type='submit' id='login_btn' name='submit'>
  6. </form>
  7. </div>
  8. <div style="height:100%;width:50%;" class='right'>
  9. </div>
  10.  
  11. html, body {
  12. margin: 0;
  13. padding: 0;
  14. overflow:hidden;
  15.  
  16. }
  17. .left {
  18.  
  19.  
  20. background: url(ui/left.png);
  21. position:absolute;
  22. background-position: center left;
  23. background-size:cover;
  24.  
  25. }
  26.  
  27. .right {
  28.  
  29. background: url(ui/right.png);
  30. background-position: center right;
  31. position:absolute;
  32. background-size:cover;
  33. right:0px;
  34.  
  35.  
  36. }
  37.  
  38. input {
  39.  
  40. outline:none;
  41.  
  42. }
  43.  
  44. .username {
  45.  
  46. border:none;
  47. width:565px;
  48. height:69px;
  49. background: url(ui/textbox.png);
  50. margin-top:300px;
  51. margin-left:120px;
  52. font-size:2em;
  53. text-align:center;
  54. color:white;
  55.  
  56. }
  57. .pw{
  58.  
  59. border:none;
  60. width:565px;
  61. height:69px;
  62. background: url(ui/textbox.png);
  63. margin-top:60px;
  64. margin-left:120px;
  65. font-size:2em;
  66. text-align:center;
  67.  
  68. }
  69.  
  70. .submit{
  71.  
  72. border:none;
  73. width:446px;
  74. height:85px;
  75. background: url(ui/button.png);
  76. margin-top:60px;
  77. margin-left:210px;
  78. font-size:2em;
  79. text-align:center;
  80. color:white;
  81.  
  82. }
  83.  
  84. <?php
  85. include("config.php");
  86. session_start();
  87.  
  88. if($_SERVER["REQUEST_METHOD"] == "POST") {
  89. // username and password sent from form
  90.  
  91. $myusername = mysqli_real_escape_string($db,$_POST['username']);
  92. $mypassword = mysqli_real_escape_string($db,$_POST['password']);
  93.  
  94. $sql = "SELECT id FROM uzivatele WHERE login = '$myusername' and heslo = '$mypassword'";
  95. $result = mysqli_query($db,$sql);
  96. $row = mysqli_fetch_array($result,MYSQLI_ASSOC);
  97.  
  98. $count = mysqli_num_rows($result);
  99.  
  100. // If result matched $myusername and $mypassword, table row must be 1 row
  101.  
  102. if($count == 1) {
  103. $_SESSION['login_user'] = $myusername;
  104. echo " $('.left').animate({left: '250px'});";
  105. }else {
  106. }
  107. }
  108. ?>
Add Comment
Please, Sign In to add comment