Home > DeveloperSection > Forums > How to register user on ejabberd using php ?
Tarun Kumar

Total Post:214

Posted on    April-21-2016 8:32 AM

 erlang OTP  erlang 

 1 Reply(s)
 1274  View(s)
Rate this:
I am working on ChattApp, I want to register users in PHP.
I google it but can't find correct solution.
Please help me.

Sunil Singh
Sunil Singh

Total Post:24

Posted on    April-21-2016 8:39 AM

try this code 

$request = xmlrpc_encode_request('register', $param, (array('encoding' => 'utf-8')));
$context = stream_context_create(array('http' => array(
    'method' => "POST",
    'header' => "User-Agent: XMLRPC::Client mod_xmlrpc\r\n" .
                "Content-Type: text/xml\r\n" .
                "Content-Length: ".strlen($request),
    'content' => $request
$file = file_get_contents("", false, $context);
$response = xmlrpc_decode($file);
if (xmlrpc_is_fault($response)) {
    trigger_error("xmlrpc: $response[faultString] ($response[faultCode])");
} else {

Don't want to miss updates? Please click the below button!

Follow MindStick