<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hawhaw SYSTEM "http://www.hawhaw.de/xml/hawhaw.dtd">
<!--
HAWHAW example for usage of checkboxes (part 2)
Norbert Huffschmid
12.11.2005
Attention: This XML file uses a server-sided scripting language (here PHP) to
create dynamic XML output according to the received form input.
You can use any other server-sided language as well.
You just have to make sure that valid XML is created and received
by the HAWHAW proxy.
-->
<?php
$points = 0;
if (!isset($_REQUEST['c1']) || (strcmp($_REQUEST['c1'], 'c') != 0)) $points += 1;
else $comment1 ="You don't go to school yet, do you?";
if (isset($_REQUEST['c2']) && (strcmp($_REQUEST['c2'], 'c') == 0)) $points += 2;
else $comment2 ="Do you know what a circle is?";
if (isset($_REQUEST['c3']) && (strcmp($_REQUEST['c3'], 'c') == 0)) $points += 3;
else $comment3 ="Have you heard about squares and roots?";
?>
<hawhaw>
<deck title="Example 4" align="center">
<?php if ($points > 0): ?> <text underline="yes">Congratulations!</text>
<?php else: ?> <text>Hmmmh, ...</text>
<?php endif; ?>
<text>You reached <?php echo $points; ?> from 6 points.</text>
<?php if ($points == 6): ?><text>You seem to be a genius!</text><?php endif; ?>
<?php if (isset($comment3)) echo "<text>$comment3</text>\n";
if (isset($comment2)) echo "<text>$comment2</text>\n";
if (isset($comment1)) echo "<text>$comment1</text>\n";
?>
</deck>
</hawhaw>