-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
77 lines (70 loc) · 1.95 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
72
73
74
75
76
77
<?php
session_start();
if (!isset($_SESSION['username'])) {
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat App - Login</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous">
<link rel="stylesheet"
href="css/style.css">
<link rel="icon" href="img/logo.png">
</head>
<body class="d-flex
justify-content-center
align-items-center
vh-100">
<div class="w-400 p-5 shadow rounded">
<form method="post"
action="app/http/auth.php">
<div class="d-flex
justify-content-center
align-items-center
flex-column">
<img src="img/logo.png"
class="w-25">
<h3 class="display-4 fs-1
text-center">
LOGIN</h3>
</div>
<?php if (isset($_GET['error'])) { ?>
<div class="alert alert-warning" role="alert">
<?php echo htmlspecialchars($_GET['error']);?>
</div>
<?php } ?>
<?php if (isset($_GET['success'])) { ?>
<div class="alert alert-success" role="alert">
<?php echo htmlspecialchars($_GET['success']);?>
</div>
<?php } ?>
<div class="mb-3">
<label class="form-label">
User name</label>
<input type="text"
class="form-control"
name="username">
</div>
<div class="mb-3">
<label class="form-label">
Password</label>
<input type="password"
class="form-control"
name="password">
</div>
<button type="submit"
class="btn btn-primary">
LOGIN</button>
<a href="signup.php">Sign Up</a>
</form>
</div>
</body>
</html>
<?php
}else{
header("Location: home.php");
exit;
}
?>