Professional Documents
Culture Documents
Code
Code
Code
py
from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/success')
def success():
return render_template('success.html')
if __name__ == '__main__':
app.run(debug=True)
Templates/index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Biometric ATM Authentication</title>
</head>
<body>
<h1>Welcome to Biometric ATM Authentication</h1>
<p><a href="/login">Login</a></p>
</body>
</html>
templates/login.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
</head>
<body>
<center>
<h1>Login</h1>
{% if error %}
<p>{{ error }}</p>
{% endif %}
<form action="/login" method="post">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required><br><br>
<label for="biometric_input">Biometric Input:</label>
<input type="text" id="biometric_input" name="biometric_input"
required><br><br>
<button type="submit">Login</button>
</form>
</center>
</body>
</html>
templates/success.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Success</title>
</head>
<body>
<center>
<h1>Authentication Successful</h1>
<p>Welcome! You have successfully logged in.</p>
</center>
</body>
</html>