-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver-ims.php
56 lines (42 loc) · 1.23 KB
/
server-ims.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
<?php
require __DIR__ . '/vendor/autoload.php';
define('APP_KEY', 'b7f6904b034d9b3bf50b');
define('APP_SECRET', '304d4c96a046a8b1d49b');
define('APP_ID', '559447');
/*$options = array(
'cluster' => 'ap1',
'encrypted' => true
);
$pusher = new Pusher\Pusher(
APP_KEY, // key
APP_SECRET, //secret
APP_ID, //appid
$options
);*/
//$data['message'] = 'hello world';
// $data = array(
// "name"=> "Liko",
// "message"=> "ims notif"
// );
$pusher = new Pusher\Pusher(APP_KEY, APP_SECRET, APP_ID, array('cluster' => 'ap1'));
// $pusher->trigger('iodev_channel', 'iodev_event', array('message' => 'hello world'));
// $pusher->trigger('iodev_channel', 'iodev_event', $data);
// $pusher = new Pusher(APP_KEY, APP_SECRET, APP_ID);
// $update_info = update_object($_POST['id'], $_POST['updated_value']);
if (isset($_POST['submit'])) {
$data = array();
$data['status'] = true;
$data['data'] = array(
"name"=> $_POST['name'],
"message"=> $_POST['message']
);
$pusher->trigger('iodev_channel', 'iodev_event', $data);
}
?>
<form action="" method="POST">
<input type="text" name="name">
<br>
<input type="text" name="message">
<br>
<input type="submit" name="submit">
</form>