Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- </head>
- <body>
- <form action="login.php" method="POST">
- <div>
- <label for="username">Username :</label>
- <input id=username type=text name=user><br>
- <label for="password">Password :</label>
- <input id=password type=password name=pass><br>
- <input type="submit" value="submit" />
- </div>
- </html>
- (login.php)
- <?php
- $username = $_POST['user'];//variabel baru, post yang diambil dari name form html
- $password = $_POST['pass'];
- echo "Nama Anda :" . $username . "<br>";
- echo "Password Anda :" . $password . "<br>";
- if ($username == "rama" && $password == "12345"){ //pengecekan login secara manual
- echo "berhasil login";
- }
- else {
- echo "gagal";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement