include("a0.php");
if ($REQUEST_METHOD == 'POST') {
$name = $_POST['name'];
} else {
$name = $_GET['name'];
}
print_h($name);
if (!($ex = ex_get($name))) {
print_f();
exit;
}
# $db = ex_connect();
# if (!($ex = ex_get($db, $name))) {
# print_f();
# exit;
# }
# echo "REQUEST_METHOD is $REQUEST_METHOD\n";
if ($REQUEST_METHOD == 'POST') {
if (!isset($name)) {
echo "Parameter 'name' missing.\n";
print_f();
exit;
}
if (!isset($word)) {
echo "Parameter 'word' missing.\n";
print_f();
exit;
}
if ((count($ex) < 2) || ($ex["wordcount"] < 1)) {
echo "Internal error: Invalid exercise descriptor.\n";
print_f();
exit;
}
for ($i = 1; $i <= $ex["wordcount"]; $i++) {
$ex[$word."on".$i] = ${$word."on".$i};
//echo $ex["word$word"]." ".$word."on".$i." ".$ex["word$i"]." ".${$word."on".$i}."
\n";
}
//echo "
"; #ex_update($db, $name, $ex); ex_update($name, $ex); } if (!isset($word)) $word = 1; echo "
"; for ($i = 1; $i <= $ex["wordcount"]; $i++) { if ($i == $word) echo "".$ex["word$i"]." "; else echo "".$ex["word$i"]." "; } echo "
\n"; ?> print_f(); ?>