Openfire and class.jabber.php

Hi

I’‘ve try to use class.jabber.php with openfire but i’'ve got an error when connecting to the server.

I’‘ve try in localhost and it’'s the same…

require(’‘class.jabber.php’’);

$JABBER = new Jabber;

$JABBER->server = ‘‘localhost’’;

$JABBER->port = ‘‘5222’’;

$JABBER->username = ‘‘XXX@XXX’’;

$JABBER->password = ‘‘XXX’’;

$JABBER->resource = ‘‘ClassJabberPHP’’;

$JABBER->Connect() or die(’‘no host!’’);

$JABBER->SendAuth() or die(’‘bad login/pass’’);

exit();

session_start();

$JABBER->SendMessage(

‘‘consultor@localhost’’, // JabberID del destinatario

‘‘normal’’, // tipo de mensaje

NULL, // identificador

array(

“subject” => ‘‘Hello World!’’,

“body” => ‘‘Hello World con ClassJabberPHP!’’,

“thread” => session_id(),

)

);

$JABBER->Disconnect();

THanks in advance for your help

Are you sure you have the right form for $JABBER->username ? What if you drop the @XXX ?

daryl

akrherz is correct, the user name is not the full jid, just the first part.

Also, look at this derived class, it’'s slightly more up-to date:

http://code.blitzaffe.com/pages/phpclasses/files/jabber_client_52-11