2.1 In continuation of QUESTION ONE, in this task, you are to create a login form. Forms, submitting requests, and interacting with a MySQL database will all be covered.
2.2 Use information on MYSQL student_reg table to login making sure you are using proper credentials.
2.3 Register button should take the user to a new page that allows them to register if they are not registered in the system.
2.4 If student’s credentials do not match the one in the database when trying to login, the page should display login error message and only three attempts are permitted before the user is kicked out of the system for 30 minutes.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Q238097</title>
</head>
<body>
<form>
<fieldset>
<h2>Login Form</h2>
<input type="text" placeholder="Username" required>
<input type="password" placeholder="Password" minlength="8" required>
<input type="submit" value="Register" onsubmit="onSubmit()">
</fieldset>
</form>
<script>
function onSubmit() {
// impl...
}
</script>
</body>
</html>
CREATE TABLE student_reg (
student_id serial,
username varchar(32) NOT NULL,
password varchar(32) NOT NULL,
PRIMARY KEY (student_id)
);
Comments
Leave a comment