-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
71 lines (63 loc) · 1.94 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login Page</title>
<link rel="stylesheet" href="styles.css">
<script src="script.js"></script>
<style>
#register-container {
display: none;
}
</style>
</head>
<body>
<div class="login-container">
<form class="login-form" action="login_check.php" method="post" id="login-form">
<h2>Login</h2>
<div class="input-group">
<label for="username">Username</label>
<input type="email" id="username" name="email" required>
</div>
<div class="input-group">
<label for="password">Password</label>
<input type="password" id="password" name="password" required>
</div>
<button type="submit" value="login">Login</button>
<p onclick="loadRegisterPage()">Don't have an account? <button onclick="loadRegisterPage()">Register</button> here.</p>
</form>
</div>
<div id="register-container"></div>
<script>
function loadRegisterPage() {
// Hide the login form
document.getElementById('login-form').style.display = 'none';
// Show the register form
document.getElementById('register-container').style.display = 'block';
document.getElementById('register-container').innerHTML = `
<!-- Your "Add Student" HTML code here -->
<div class="registration-form">
<form method="post" action="process.php">
<label>ID</label>
<input type="text" name="id" />
<br />
<label>Name</label>
<input type="text" name="name" />
<br />
<label>Address</label>
<input type="text" name="address" />
<br />
<label>Password</label>
<input type="password" name="password" />
<br />
<label>Email</label>
<input type="text" name="email" />
<br />
<input type="submit" value="Register">
</form>
</div>
`;
}
</script>
</body>
</html>