multiLevelURL()

string multiLevelURL(string questionnaire, [mixed data, mixed Hash])

The function multiLevelURL() works like multiLevelDown(), but does not lead the respondents directly to the subordinate questionnaire (Multi-Level Structure), but generates a URL with which the questionnaire can be called up later. The function is particularly useful in connection with sending emails, e.g. using mailSend() or mailSchedule().

By default, multiLevelURL() generates only one case and link per interview. This means that the same URL can be displayed even if the questionnaire page is called up several times with the PHP code. If different cases are to be generated, a value must be entered for the Hash.

Example

In the following example, a case is to be created for each e-mail address in the $emails array and the link is to be sent to the respective address. The link leads to the „details“ questionnaire. The e-mail address is made available in the subordinate questionnaire for multiLevelData() and at the same time used as Hash so that a different case and link is created for each e-mail address.

In this example, serial mail 1 contains a placeholder %link%, where the link is displayed.

foreach ($emails as $email) {
    $url = multiLevelURL('details', $email, $email);
    mailSend($email, 1, 0, $url);
}