Advertisement
Guest User

Untitled

a guest
Apr 29th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>Document</title>
  8. </head>
  9. <body>
  10. <form action="login.php" method="POST">
  11. <div>
  12. <label for="username">Username :</label>
  13. <input id=username type=text name=user><br>
  14.  
  15. <label for="password">Password :</label>
  16. <input id=password type=password name=pass><br>
  17.  
  18. <input type="submit" value="submit" />
  19. </div>
  20. </html>
  21.  
  22.  
  23. (login.php)
  24. <?php
  25.  
  26. $username = $_POST['user'];//variabel baru, post yang diambil dari name form html
  27. $password = $_POST['pass'];
  28.  
  29. echo "Nama Anda :" . $username . "<br>";
  30. echo "Password Anda :" . $password . "<br>";
  31.  
  32. if ($username == "rama" && $password == "12345"){ //pengecekan login secara manual
  33. echo "berhasil login";
  34. }
  35. else {
  36. echo "gagal";
  37. }
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement