serverurl.'/user/get_token'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, format_postdata($connectiondata)); $token = curl_exec($ch); $data['token'] = $token; curl_setopt($ch, CURLOPT_URL, $CFG->serverurl.'/user/create_user'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, format_postdata($data)); $out = curl_exec($ch); $res = basicxml_xml_to_object($out); show_object($res->userid); show_xml ($out); end_interface(); ?>