Skip to content

Instantly share code, notes, and snippets.

@Teino1978-Corp
Created November 19, 2015 11:04
Show Gist options
  • Save Teino1978-Corp/eba223b0e5669dd3595e to your computer and use it in GitHub Desktop.
Save Teino1978-Corp/eba223b0e5669dd3595e to your computer and use it in GitHub Desktop.
E-banking
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login User</title>
</head>
<body>
<h1>Dream Bank</h1>
<form method="post" action="beranda.php">
<p><label>Username :</label>
<input type="text" name="user" autofocus></p>
<p><label>Password. :</label>
<input type="password" name="pass"></p>
<p>
<button type="submit" >Sign In</button>
</p>
</form>
</body>
</html>
<?php
$file = fopen("nasabah.csv", "r");
$username = ($_POST['user']);
$password = ($_POST['pass']);
$success = false;
while (!feof($file) !== false) {
if ($data[0] == $username && $data[1] == $password) {
$success = true;
break;
}
}
session_start();
fclose($data)
?>
<? php
session_start();
if (isset($_SESSION['sukses'] ))
echo " balance anda : 0 ";
else
echo "you have not logged";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment