$_REQUEST['c'], 'session_id' => $_REQUEST['s'], 'user' => $invitation_code, 'survey_code' => $survey_data['code'], 'invitation_code' => $invitation_code, 'invitation_date' => api_get_utc_datetime() ); $invitation_id = SurveyUtil::save_invitation($params); if ($invitation_id) { $link = api_get_path(WEB_CODE_PATH). 'survey/fillsurvey.php ?invitationcode='.$invitation_code. '&course='.$course_info['code']. 'cidReq='.$course_info['code'] ; header('Location: '.$link); exit; } } else { api_not_allowed(true); }