- Posts: 10
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
<?php require_once 'jsonRPCClient.php'; define( 'LS_BASEURL', 'https://localhost/limeSurvey5x'); define( 'LS_USER', 'admin' ); define( 'LS_PASSWORD', 'password' ); $iSurveyID = 392446; if(ctype_alnum($iSurveyID) && (strlen($iSurveyID) == 5 || strlen($iSurveyID) == 6)) { // Valid SID format // Instantiate a new RPC client $myJSONRPCClient = new jsonRPCClient( LS_BASEURL.'/index.php/admin/remotecontrol' ); // Get a session key $sSessionKey= $myJSONRPCClient->get_session_key( LS_USER, LS_PASSWORD ); if(is_array($sSessionKey)) { // Invalid session echo $sSessionKey['status']; } else if($sSessionKey) { // Valid session $newTitle = 'TEST SURVEY 1'; $newDescription = 'Some survey description...'; $newWelcomeMsg = '<p style="font-weight: bold;">Some welcome message.</p><p>And, another paragraph.</p>'; $newEndMsg = 'Some end message...'; $aSurveyLocaleData = array( 'surveyls_title' => $newTitle, 'surveyls_description' => $newDescription, 'surveyls_welcometext' => $newWelcomeMsg, 'surveyls_endtext' => $newEndMsg ); $sLanguage = 'en'; $newLanguageProperties = $myJSONRPCClient->set_language_properties($sSessionKey, $iSurveyID, $aSurveyLocaleData, $sLanguage); print_r($newLanguageProperties); } // Release the session key $myJSONRPCClient->release_session_key( $sSessionKey ); } else { // Invalid SID format die( 'Invalid format!' ); } ?>
Please Log in to join the conversation.
Please Log in to join the conversation.