-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
65 lines (60 loc) · 1.53 KB
/
index.php
File metadata and controls
65 lines (60 loc) · 1.53 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
61
62
63
64
65
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>Pusher Demo | Using JS</title>
<script>
var pusher = new Pusher('308ec3a55dfd284497af', {
cluster: 'ap2',
encrypted: false
});
var channel = pusher.subscribe('my-channel');
channel.bind('my-event', function(response) {
var message = document.getElementById('displayData');
message.innerHTML = message.innerHTML+ "<tr><td>"+response.name+"</td><td>"+response.message+"</td></tr><tr><td colspan='2'><hr size='1' color='#e1e1e1'></td></tr>";
});
</script>
</head>
<body>
<div id="wrapper">
<h3>Pusher Demo</h3>
<hr size="2" color="black">
<h5></h5>
<form action="notify.php" method="post">
<table width="50%" border="0">
<tr>
<td width="45%">Name</td>
<td>:</td>
<td width="45%"><input class="full_w" type="text" name="txtName"></td>
</tr>
<tr>
<td>Message</td>
<td>:</td>
<td><textarea class="full_w" name="txtMessage"></textarea></td>
</tr>
<tr>
<td colspan="2"></td>
<td>
<input class="half_w" type="Submit" value="Send">
<input class="half_w" type="Reset" value="Reset">
</td>
</tr>
</table>
</form>
<hr size="2" color="black">
<h3>Your Messages</h3>
<hr size="1" color="#a1a1a1">
<div>
<table id="displayData" width="100%">
<tr>
<td><b>Name</b></td>
<td><b>Message</b></td>
</tr>
<tr>
<td colspan="2"><hr size="1" color="a1a1a1"></td>
</tr>
</table>
</div>
</div>
</body>
</html>