-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
118 lines (87 loc) · 3.08 KB
/
index.php
File metadata and controls
118 lines (87 loc) · 3.08 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
require 'core/init.php';
if(logged_in() === true){
header('Location:home.php');
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Asset Management System</title>
<link href="https://fonts.googleapis.com/css2?family=Readex+Pro:wght@500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" media="screen" href="css/screen2.css">
<script src="js/activation.js"></script>
<script>
function validateForm() {
var email = document.forms["registration"]["email"].value;
if (!validateEmail(email)) {
alert("Enter a valid email address");
return false;
}
var password = document.forms["registration"]["password"].value;
if (password.length < 6) {
alert("Password must have at least 6 characters");
return false;
}
}
//function validateEmail(email) {
// var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
// return re.test(email);
//}
</script>
</head>
<body>
<div id="page">
<header>
<a title="asset" href="">
<div class="logo">
<a href =""><img src="images/WHITE.png" height="60px" weight="50px" /></a>
</div>
</a>
<nav>
<span id="title"> Asset Management System</span>
</nav>
</header>
<div class="left"><img src="images/Front.jpg" alt="">
<br />
</div>
<div class="button1"><a href="chart.php" title="charts">Charts</a></div>
<div class="right">
<?php
if(empty($_POST['login']) === false){
$email = $_POST['email'];
$password = $_POST['password'];
$login = login($con,$email,$password);
if($login === false){?>
<script>
alert('Your email and password combination is wrong');
</script>
<?php
}else{
$_SESSION['id']= $login;
header('Location:home.php');
exit();
}
}
?>
<h1>Login</h1>
<form action="" method="post" name="login">
<label for="email"><b>Admin</b></label><br>
<input id="text_input" type="text" name="email">
<br />
<label for="password"><b>Password</b></label><br>
<input id="text_input" type="password" name="password">
<br/>
<input id="btn_block" type="submit" value="Login" name="login" style="margin-left:10px;font-weight:bold;border-radius:3rem;"/>
</form>
<hr />
<span id="footer">©<a href ="register.php" title="project">Register Here</a><br><br><br>
<a href ="Website/Website.html" title="project">Back to home page</a><br><br><br>
</span>
</div>
</body>
</html>