-
Notifications
You must be signed in to change notification settings - Fork 32
/
chat1.php
125 lines (81 loc) · 2.54 KB
/
chat1.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
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
119
120
121
122
<form action="deletechat.php" method="GET" >
<button type="submit" class="btn btn-danger" style="position:absolute;top:20px;left:10px;">Delete all chat</button>
</form>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div id="limit">
<center >
<form action="adchatinsert.php" method="POST" class="chatinput" >
<input type="text" name="username" value="admin" readonly style='border-radius:50px;border:1px solid green;'><br><br><br>
<input type="text" name="msg" id="msg" placeholder=" type your message here"><br><br>
<button type="submit" class="btn btn-lg btn-success" style="border-radius:50%;"><span class="glyphicon glyphicon-send"></span></button>
</form>
</center>
<style>
.chatmsg
{
background-color: #075bff;
border: 1px solid #075bff;
border-radius: 10px;
height:auto;
width:20%;
padding: 8px;
color: red;
}
.adchatmsg
{
background-color: #5FCF80;
border: 1px solid #5FCF80;
border-radius: 10px;
height:auto;
width:20%;
padding: 8px;
color: white;
}
#chats
{
text-align: center;
width:50%;
height: auto;
border-radius: 30px;
background: url('wall.png');
padding-top: 10px;
min-height: 80%;
}
#msg
{
height:80px;
width:700px;
border:1px solid green;
border-radius: 50px;
background-color: lightyellow;
}
#limit
{
background-image:url('wall.jpg');
}
</style>
<script>
function displaychat()
{
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function()
{
if (this.readyState == 4 && this.status == 200)
{
document.getElementById("chats").innerHTML = this.responseText;
}
}
xmlhttp.open("GET", "chatdisplay.php", true);
xmlhttp.send();
}
setInterval(displaychat,10);
</script>
<center>
<div id="chats">
</div>
</center>
</div>