forked from rifkichaplin/php-chatbot-jabber-transaksi-pulsa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sendingmessage.php
34 lines (24 loc) · 1.04 KB
/
sendingmessage.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
<?php
// activate full error reporting
//error_reporting(E_ALL & E_STRICT);
//include 'XMPPHP/XMPP.php';
include 'connvoulec.php';
#Use XMPPHP_Log::LEVEL_VERBOSE to get more logging for error reports
#If this doesn't work, are you running 64-bit PHP with < 5.2.6?
try {
$conn->connect();
$conn->processUntil('session_start');
$conn->presence();
//$conn->processTime(3);
$t=time();
$query = 'INSERT INTO jabber_out (id_jabber,format_out,id_transaction,last_update) VALUES ("'.$argv[1].'","'.$argv[2].'","'.$argv[3].'","'.date('Y-m-d H:i:s',$t).'")';
mysqli_query($connect_db, $query);
//if(! mysql_query($query,$connect_db) ) {
// die('Gagal tambah data: ' . mysql_error());
//}
$conn->message("$argv[1]","$argv[2]");
echo "OK|".$query;
$conn->disconnect();
} catch(XMPPHP_Exception $e) {
die($e->getMessage());
}