0% found this document useful (0 votes)
10 views

code1

Uploaded by

susilarani208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

code1

Uploaded by

susilarani208
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login System</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
}

.login-container {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}

.form-group {
margin-bottom: 20px;
}

input {
width: 100%;
padding: 8px;
margin-top: 5px;
margin-bottom: 10px;
box-sizing: border-box;
}

.btn {
background-color: #4caf50;
color: white;
padding: 10px 15px;
border: none;
border-radius: 4px;
cursor: pointer;
}
</style>
</head>
<body>

<div class="login-container">
<h2>Admin Login</h2>
<div class="form-group">
<input type="text" id="adminUsername" placeholder="Username">
</div>
<div class="form-group">
<input type="password" id="adminPassword" placeholder="Password">
</div>
<button class="btn" onclick="adminLogin()">Login</button>
<p>Don't have an account? <a href="#">Register</a></p>
</div>

<div class="login-container">
<h2>User Login</h2>
<div class="form-group">
<input type="text" id="userUsername" placeholder="Username">
</div>
<div class="form-group">
<input type="password" id="userPassword" placeholder="Password">
</div>
<button class="btn" onclick="userLogin()">Login</button>
<p>Don't have an account? <a href="#">Create New Account</a></p>
</div>

<script>
function adminLogin() {
var username = document.getElementById("adminUsername").value;
var password = document.getElementById("adminPassword").value;

// Simple validation
if (username === "admin" && password === "admin123") {
alert("Admin login successful!");
} else {
alert("Invalid admin credentials");
}
}

function userLogin() {
var username = document.getElementById("userUsername").value;
var password = document.getElementById("userPassword").value;

// Simple validation
if (username === "user" && password === "user123") {
alert("User login successful!");
} else {
alert("Invalid user credentials");
}
}
</script>

</body>
</html>

You might also like