forked from Its-Aman-Yadav/Community-Site
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Its-Aman-Yadav#714 from Poonam-Kashyap12/main
Issue No. = Its-Aman-Yadav#670 Now, signup page working properly, Issue No.= Its-Aman-Yadav#669 Now, login page working properly ,Issue no.=Its-Aman-Yadav#624 now ,email accepting valid input
- Loading branch information
Showing
2 changed files
with
118 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,73 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="login.css" /> | ||
<!-- font-awesome link --> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" | ||
/> | ||
<title>Login/Register</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<input type="checkbox" id="flip" /> | ||
<div class="cover"> | ||
<div class="front"> | ||
<div class="text"> | ||
<img src="images/Slide1.jpg" alt="" /> | ||
</div> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="login.css" /> | ||
<!-- font-awesome link --> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" | ||
/> | ||
<title>Login page</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="cover"> | ||
<div class="front"> | ||
<div class="text"> | ||
<img src="images/Slide1.jpg" alt="" /> | ||
</div> | ||
</div> | ||
<form action="#"> | ||
<div class="form-content"> | ||
<div class="login-form"> | ||
<div class="title">Login</div> | ||
<div class="input-boxes"> | ||
<div class="input-box"> | ||
<i class="fas fa-envelope"></i> | ||
<input type="text " placeholder="Enter your Email" required /> | ||
</div> | ||
<div class="input-box"> | ||
<i class="fas fa-lock"></i> | ||
<input | ||
type="password" | ||
placeholder="Enter your Password" | ||
required | ||
/> | ||
</div> | ||
<div class="text"><a href="#">Forgot password?</a></div> | ||
<div class="button input-box"> | ||
<input type="submit" value="Submit" /> | ||
</div> | ||
<div class="text login-text"> | ||
Don't have an account? <label for="flip">Signup now</label> | ||
</div> | ||
</div> | ||
|
||
<!-- Login Form --> | ||
<form id="loginForm"> | ||
<div class="form-content"> | ||
<div class="login-form"> | ||
<div class="title">Login</div> | ||
<div class="input-boxes"> | ||
<div class="input-box"> | ||
<i class="fas fa-envelope"></i> | ||
<input type="email" id="myemail" placeholder="Enter your Email" required /> | ||
</div> | ||
</div> | ||
<div class="signup-form"> | ||
<div class="title">Signup</div> | ||
<div class="input-boxes"> | ||
<div class="input-box"> | ||
<i class="fas fa-user"></i> | ||
<input type="text " placeholder="Enter your Name" required /> | ||
</div> | ||
<div class="input-box"> | ||
<i class="fas fa-envelope"></i> | ||
<input type="text " placeholder="Enter your Email" required /> | ||
</div> | ||
<div class="input-box"> | ||
<i class="fas fa-lock"></i> | ||
<input | ||
type="password" | ||
placeholder="Enter your Password" | ||
required | ||
/> | ||
</div> | ||
|
||
<div class="button input-box"> | ||
<input type="submit" value="Submit" /> | ||
</div> | ||
<div class="text sign-up-text"> | ||
Already have an account? <label for="flip">Login now</label> | ||
</div> | ||
<div class="input-box"> | ||
<i class="fas fa-lock"></i> | ||
<input type="password" id="mypassword" placeholder="Enter your Password" required /> | ||
</div> | ||
<div class="text"><a href="#">Forgot password?</a></div> | ||
<div class="button input-box"> | ||
<input type="button" value="Submit" onclick="authenticate()" /> | ||
</div> | ||
<div class="text login-text"> | ||
Don't have an account? <a href="signup.html">Sign Up</a> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</body> | ||
</div> | ||
</form> | ||
</div> | ||
<script> | ||
// User credentials object | ||
const users = [ | ||
{ email: '[email protected]', password: 'password1' }, | ||
{ email: '[email protected]', password: 'password2' }, | ||
{ email: '[email protected]', password: 'password3' } | ||
]; | ||
|
||
function authenticate() { | ||
var email = document.getElementById("myemail").value; | ||
var password = document.getElementById("mypassword").value; | ||
|
||
// Check if the entered email and password match any of the predefined credentials | ||
const authenticatedUser = users.find(user => user.email === email && user.password === password); | ||
|
||
if (authenticatedUser) { | ||
window.location.href = "index.html"; | ||
} else { | ||
alert('Invalid email or password'); | ||
} | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<link rel="stylesheet" href="login.css" /> | ||
<!-- font-awesome link --> | ||
<link | ||
rel="stylesheet" | ||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" | ||
/> | ||
<title>Signup</title> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="cover"> | ||
<div class="front"> | ||
<div class="text"> | ||
<img src="images/Slide1.jpg" alt="" /> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- Signup Form --> | ||
<form action="index.html" method="get"> | ||
<div class="form-content"> | ||
<div class="signup-form"> | ||
<div class="title">Signup</div> | ||
<div class="input-boxes"> | ||
<div class="input-box"> | ||
<i class="fas fa-user"></i> | ||
<input type="text" id="username" placeholder="Enter your Name" required /> | ||
</div> | ||
<div class="input-box"> | ||
<i class="fas fa-envelope"></i> | ||
<input type="email" id="myemail" placeholder="Enter your Email" required /> | ||
</div> | ||
<div class="input-box"> | ||
<i class="fas fa-lock"></i> | ||
<input type="password" id="mypassword" placeholder="Enter your Password" required /> | ||
</div> | ||
<div class="button input-box"> | ||
<input type="submit" value="Submit" /> | ||
</div> | ||
<div class="text sign-up-text"> | ||
Already have an account? <a href="login.html">Login now</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</body> | ||
</html> |