-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchat.php
More file actions
60 lines (57 loc) · 1.71 KB
/
chat.php
File metadata and controls
60 lines (57 loc) · 1.71 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
<?php
include 'connect.php';
if(isset($_SESSION['username']))
{
if(isset($_POST['sender']))
{
$sender=$_POST['sender'];
$_SESSION['sender']=$sender;
}
$user=$_SESSION['username'];
?>
<html>
<body onload="fun1()">
<meta charset='utf-8'>
<meta name='viewport' width='device-width,initial-scale=1'>
<script type='text/javascript' src='js/bootstrap.min.js'></script>
<link rel='stylesheet' type='text/css' href='css/bootstrap.min.css'>
<link href='delta_css.css' rel='stylesheet' type='text/css'>
<div id='div7'>
<h4><strong>Hi! <?php echo$user;?></strong></h4>
<a href='delta_logout.php'>Logout</a><br>
<a href='room.php'>Go Back</a><br>
<a href='clear.php'>Clear ChatBox</a><br>
<a href='upchat.php'>Unarchive Chat</a>
</div>
<div id='chatt'>
<script type="text/javascript">
function fun1(){
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("chatt").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("POST","test.php",true);
xmlhttp.send();setTimeout(fun1,5000);
}
</script>
</div>
<form class='form-inline' role='form' method='post' action='message.php'>
<div class='row'>
<div class='form-group' id='div5'>
<div class='col-lg-8'>
<input type='text' class='form-control' onmouseout="fun2(this.value)" name='message' placeholder='Enter message here'>
</div>
<div class="col-md-4">
<input type="submit" value="submit" class="btn btn-primary btn-block">
</div>
</div>
</div></body></html>";
<?php
}
else
header("Location:del_start.php");
?>