Created
March 14, 2017 06:52
-
-
Save bonatuamanihuruk/0cc9876581b3266823c2b74d4b633203 to your computer and use it in GitHub Desktop.
Login sederhana dengan php dan bootstrap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Login</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<style> | |
body{padding-top: 20px;} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<?php | |
if(isset($_POST['login'])){ | |
$username=$_POST['username']; | |
$password=$_POST['password']; | |
if($username=="user1" && $password=="user1"){ | |
echo "<div class='alert alert-success' role='alert'>Username dan Password Benar</div>"; | |
}else{ | |
echo "<div class='alert alert-danger' role='alert'>Username dan Password Salah</div>"; | |
} | |
} | |
?> | |
<div class="col-md-4 col-md-push-4 "> | |
<form method="post"> | |
<div class="form-group"> | |
<label for="Username">Username</label> | |
<input type="text" class="form-control" name="username" placeholder="Username"> | |
</div> | |
<div class="form-group"> | |
<label for="password">Password</label> | |
<input type="password" class="form-control" name="password" placeholder="Password"> | |
</div> | |
<button type="submit" name="login" class="btn btn-default">Login</button> | |
</form> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment