-
Notifications
You must be signed in to change notification settings - Fork 0
/
chat.php
73 lines (63 loc) · 1.93 KB
/
chat.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
<?
header('cache:private');
session_start();
$user = "";
if ($_POST)
{
if (isset($_POST['user']))
{
$user = $_POST['user'];
}
}
if (strlen($user) > 0)
$_SESSION['user'] = $user;
if (!isset($_SESSION['user']))
{
header('location:index.php');
return;
}
?>
<html>
<head>
<title>Chat</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="js/node_modules/socket.io/node_modules/socket.io-client/socket.io.js"></script>
<script src="js/client.js"></script>
</head>
<body>
<div class="container">
<div class="panel-group">
<div class="col-xs-10">
<div class="panel panel-primary">
<div class="panel-heading">Chat</div>
<div class="panel-body" id="messages" style="height: 80%; max-height: 80%;overflow-y: scroll;overflow-x: none;">
</div>
</div>
</div>
<div class="col-xs-2">
<div class="panel panel-primary">
<div class="panel-heading">Members</div>
<div class="panel-body" id="members" style="height: 80%; max-height: 80%;overflow-y: scroll;">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="navbar navbar-fixed-bottom" >
<div class="navbar-inner" id="test">
<form class="form-inline" id="messageForm">
<input type="text" id="messageInput" autocomplete="off" style="width:85%;">
<input type="hidden" id="messageName" value="<? echo $_SESSION['user']; ?>">
<input type="submit" id="messageSubmit" class="btn">
<a href="logout.php" class="btn">Log Out</a>
</form>
</div>
</div>
</div>
</body>
</html>