Reputation: 45
I would like to develope a chat using JAXL libraries.
after the connection, i'm using this code to send a message:
$client->send_chat_msg('[email protected]', 'test');
and this code just to show a message has been received.
$client->add_cb('on_chat_message', function() {
global $client;
echo "Message received";
});
The problem is:
How can this code works if php is only executed when the page is loaded?
same problem to send messages, how can i send a message without reloading the page?
Any help really appreciated Thank you Marco
Upvotes: 2
Views: 1909
Reputation: 1638
You are looking at the wrong tool and asking the wrong question.
To run an XMPP client in your user's browser, use Strophe.js or any javascript XMPP client.
JAXL is - when you want to run a client on the server, such as a chatting bot.
Upvotes: 4