Beispiel #1
0
/* << USAGE SAMPLE >> */
$how = new questionnaire();
include_once "header.php";
// html and bootstrap initiated
echo $how->form;
$how->aQuestion("Arbejder du med WordPress?");
$how->janej("frontend");
$how->aQuestion("I hvor høj grad arbejder du med disse f*g:");
$how->fiveRadio("Design", "I høj grad", "Slet ikke");
$how->fiveRadio("Business", "I høj grad", "Slet ikke");
$how->fiveRadio("Interaction", "I høj grad", "Slet ikke");
$how->fiveRadio("Communication", "I høj grad", "Slet ikke");
$how->aQuestion("FOSS CMS?");
include_once "cmsList.php";
// the list of the most used FOSS CMSs
foreach ($cmsList as $row) {
    $how->setMark($row);
    // loop out the option list
}
$how->write("Andre");
$how->aQuestion("Tak for dine svar. Gem dine svar ved at klikke på Gem.");
$how->submit("Gem");
echo $how->formEnd;
include_once "footer.php";
$ip = $_SERVER['REMOTE_ADDR'];
// user ip (may be random or arbitrary)
/* ... whatever the form GETs ... */
$svar = $_REQUEST;
array_pop($svar);
// remove the submit button
echo '<div class="alert alert-info" role="alert"><h3>Resultat</h3>Answers from: ' . $ip . '<br><pre>' . json_encode($svar) . '</pre></div>';