-
Notifications
You must be signed in to change notification settings - Fork 0
/
students.php
41 lines (35 loc) · 1.16 KB
/
students.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
<?php include "includes/header.php"?>
<?php include "includes/db.php" ?>
<!DOCTYPE html>
<head>
<title>Pusher Test</title>
<script src="https://js.pusher.com/7.0/pusher.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet" />
<script>
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
var pusher = new Pusher('2d2ad570015d44548763', {
cluster: 'us2'
});
var channel = pusher.subscribe('my-channel');
channel.bind('my-event', function(data) {
//alert(JSON.stringify(data));
var myNewdata = (JSON.stringify(data));
toastr.success(myNewdata);
});
</script>
</head>
<body>
<h1>Pusher Test</h1>
<p>
Try publishing an event to channel <code>my-channel</code>
with event name <code>my-event</code>.
</p>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js" ></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<script>
//toastr.success('HELLO');
</script>
</body>
<!-- Footer -->
<?php include "includes/footer.php"?>