Advertisement
Guest User

Untitled

a guest
Nov 14th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.69 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ?>
  4. <html>
  5. <head>
  6.  
  7. <style>
  8. * { margin: 0; padding: 0; box-sizing: border-box; }
  9.  
  10.  
  11. body {
  12. background:#596778;
  13. color: #5e5e5e;
  14. font: 400 87.5%/1.5em helvetica 'Open Sans', sans-serif;
  15. }
  16.  
  17.  
  18. .form-wrapper {
  19. background: #fafafa;
  20. margin: 3em auto;
  21. padding: 0 1em;
  22. max-width: 370px;
  23. }
  24.  
  25. h1 {
  26. text-align: center;
  27. padding: 1em 0;
  28. }
  29.  
  30. form {
  31. padding: 0 1.5em;
  32. }
  33.  
  34. .form-item {
  35. margin-bottom: 0.75em;
  36. width: 100%;
  37. }
  38.  
  39. .form-item input {
  40. background: #fafafa;
  41. border: none;
  42. border-bottom: 2px solid #e9e9e9;
  43. color: #666;
  44. font-family: 'Open Sans', sans-serif;
  45. font-size: 1em;
  46. height: 50px;
  47. transition: border-color 0.3s;
  48. width: 100%;
  49. }
  50.  
  51. .form-item input:focus {
  52. border-bottom: 2px solid #c0c0c0;
  53. outline: none;
  54. }
  55.  
  56. .button-panel {
  57. margin: 2em 0 0;
  58. width: 100%;
  59. }
  60.  
  61. .button-panel .button {
  62. background: skyblue;
  63. border: none;
  64. color: #fff;
  65. cursor: pointer;
  66. height: 50px;
  67. font-family: 'Open Sans', sans-serif;
  68. font-size: 1.2em;
  69. letter-spacing: 0.05em;
  70. text-align: center;
  71. text-transform: uppercase;
  72. transition: background 0.3s ease-in-out;
  73. width: 100%;
  74. }
  75.  
  76.  
  77. .form-footer {
  78. font-size: 1em;
  79. padding: 2em 0;
  80. text-align: center;
  81. }
  82.  
  83. .form-footer a {
  84. color: #8c8c8c;
  85. text-decoration: none;
  86. transition: border-color 0.3s;
  87. }
  88.  
  89. .form-footer a:hover {
  90. border-bottom: 1px dotted #8c8c8c;
  91. }
  92.  
  93. </style>
  94. </head>
  95. <body>
  96. <div class="form-wrapper">
  97. <h1>Indo Travel</h1>
  98. <form method="POST" action="">
  99. <div class="form-item">
  100. <label for="user"></label>
  101. <?php
  102. include("coo.php");
  103. if(isset($_POST["input"])){
  104. $a=$_POST["user"];
  105. $b=$_POST["password"];
  106. $query=mysql_query("SELECT * FROM user WHERE username='$a' AND password='$b'");
  107. if(mysql_num_rows($query) == 1){
  108. $row=mysql_fetch_array($query);
  109. $_SESSION['username']=$a;
  110. $_SESSION['ktp']=$row['no_ktp'];
  111. $_SESSION['almt']=$row['alamat'];
  112. $_SESSION['no_telp']=$row['telp'];
  113. header("Location:home.php");
  114. }else if($a=='admin' && $b='admin'){
  115. header("Location:admin.php");
  116. }
  117. else{
  118. echo"<center>Username atau Password salah</center>";
  119. }
  120. }
  121. ?>
  122. <input type="text" name="user" required="required" placeholder="Username"></input>
  123. </div>
  124. <div class="form-item">
  125. <label for="password"></label>
  126. <input type="password" name="password" required="required" placeholder="Password"></input>
  127. </div>
  128. <div class="button-panel">
  129. <input type="submit" name="input" class="button" title="Log In" value="Login"></input>
  130. </div>
  131. </form>
  132. <div class="form-footer">
  133. <p><a href="signup.php">Sign up</a></p>
  134. </div>
  135. </div>
  136. </body>
  137. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement