-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
50 lines (33 loc) · 945 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf8">
<title>Document</title>
<link rel="stylesheet" href="style.css">
</head>
<?php
ob_start();
session_start();
$pageTitle = 'Login';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['login'])) {
$user = $_POST['username'];
$_SESSION['username'] = $user;
header('Location: chat.php');
}
}
?>
<div class="container login-page">
<!-- Start Login Form -->
<form class="login container" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
<h1 class="text-center">
<span class="selected" data-class="login">Login</span>
</h1>
<div class="input-container">
<input class="form-control" type="text" name="username" autocomplete="off" placeholder="Type your username" required />
</div>
<input class="btn btn-primary btn-block" name="login" type="submit" value="Login" />
</form>
<?php
ob_end_flush();
?>