Guest User

menggil database

a guest
Feb 26th, 2016
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. <?php
  2. session_start();
  3. get_include_path("inc/koneksi.php")
  4.  
  5. ?>
  6.  
  7.  
  8. <html>
  9. <head>
  10. <title> GameCloud.com </title>
  11. <style type="text/css">
  12.  
  13.  
  14.  
  15. #utama
  16. {
  17. width : 300px;
  18. margin : 0 auto;
  19. margin-top : 300;
  20. }
  21.  
  22. #judul
  23. {
  24. padding: 10px ;
  25. text-align : center;
  26. color : #ffffff;
  27. font-size : 22px;
  28. background-color : #034766;
  29. border-top-right-radius : 20px;
  30. border-top-left-radius : 20px;
  31. }
  32.  
  33. #inputan
  34. {
  35. background-color : #00ff00;
  36. padding : 15px;
  37. border-bottom-right-radius : 20px;
  38. border-bottom-left-radius : 20px;
  39.  
  40.  
  41. }
  42.  
  43. input
  44. {
  45. padding : 10px;
  46. border : 0;
  47. background-color: #00fffc;
  48.  
  49.  
  50. }
  51.  
  52. .lg
  53. {
  54. width : 260px;
  55.  
  56.  
  57. }
  58.  
  59. .btn
  60. {
  61. background-color: #00ff00;
  62. border-radius : 10px;
  63. color : #000000;
  64. margin-bottom : 20px
  65. margin-top : -40;
  66.  
  67.  
  68.  
  69. }
  70.  
  71. .btn:hover
  72. {
  73. background-color : #034766;
  74. cursor : pointer;
  75.  
  76. }
  77.  
  78. .btn2
  79. {
  80.  
  81. background-color: #00ff00;
  82. border-radius : 10px;
  83. color : #000000;
  84. margin-left: 225;
  85. margin-top : -70;
  86.  
  87. }
  88.  
  89. .btn2:hover
  90. {
  91. background-color : #034766;
  92. cursor : pointer;
  93.  
  94. }
  95. .pass
  96. {
  97. background-color: #00ff00;
  98. border-radius : 10px;
  99. color : #000000;
  100. margin-top : -6;
  101. margin-left : 62;
  102.  
  103. }
  104.  
  105. .pass:hover
  106. {
  107. background-color : #034766;
  108. cursor : pointer;
  109.  
  110. }
  111.  
  112. </style>
  113. </head>
  114.  
  115. <body background="loginbackground.jpg">
  116.  
  117. <div id="utama">
  118.  
  119. <div id="judul">
  120. login
  121. </div>
  122.  
  123. <div id="inputan";>
  124.  
  125. <form action="" method="post">
  126.  
  127.  
  128.  
  129. <div>
  130. <input type="text" name="user" placeholder="username" class="lg"/>
  131. </div>
  132.  
  133.  
  134. <div style="margin-top:10px;">
  135. <input type="password" name="pass" placeholder="Password" class="lg" />
  136. </div>
  137.  
  138.  
  139.  
  140.  
  141. <div id="remember-container" style="margin-top:20px;">
  142. <input type="checkbox" id="checkbox-2" class="checkbox" checked="checked"/>
  143. <span id="remember">Remember me</span>
  144. </div>
  145.  
  146.  
  147. </div>
  148.  
  149. </body>
  150.  
  151.  
  152.  
  153. <div style="margin-top:19px;">
  154. <input type="submit" name="signup" value="sign up" class="btn" />
  155. </div>
  156.  
  157. <div style="margin-top:19px;">
  158. <input type="submit" name="login" value="login" class="btn2" />
  159. </div>
  160. </form>
  161.  
  162. <?php
  163.  
  164. $user = @$_POST['user'];
  165. $pass = @$_POST['pass'];
  166. $login= @$_POST['login'];
  167.  
  168.  
  169.  
  170.  
  171. if ($login)
  172. {
  173. if(empty($user) || empty($pass))
  174.  
  175. {
  176. ?> <script type="text/javascript">alert("username/password tidak boleh kosong euy");</script><?php
  177.  
  178. }
  179. else
  180. {
  181. $sql = mysql_query("select * from tb_login where username= '$user' and password = md5('$pass')") or die(mysql_error());
  182. $cek = mysqli_num_rows($sql);
  183. echo $cek;
  184.  
  185. }
  186.  
  187.  
  188. }
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195. ?>
  196.  
  197. </div>
  198. </div>
  199. </body>
  200. </html>
Add Comment
Please, Sign In to add comment