Skip to content

Instantly share code, notes, and snippets.

@pujie
Created October 19, 2015 01:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pujie/b645d9ccf60fa6c1c5ac to your computer and use it in GitHub Desktop.
Save pujie/b645d9ccf60fa6c1c5ac to your computer and use it in GitHub Desktop.
simulasi login sederhana
<html>
<head>bercanda</head>
<body>
<form action="index.php" method="post">
Nama <input type="text" name="name"/><br />
Pass <input type="text" name="pass"/>
<input type="submit" value="LOGIN">
</form>
<?php
$users = array(
"budi"=>"budi123",
"yudi"=>"yudi123",
"rudi"=>"rudi123",
"dudi"=>"dudi123",
"sudi"=>"sudi123",
);
$params = $_POST;
if($users[$params['name']]===$params['pass']){
echo 'sukes login';
}else{
echo 'gagal login';
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment