Okay, I think I am much closer. I moved my randomizer to near the top of register.php and made it a global variable:
function do_register0() {
global $main_smarty, $the_template, $mynumber;
$number1 = mt_rand(1,10);
$number2 = mt_rand(1,25);
$mynumber = $number1+$number2;
$main_smarty->assign('number1', $number1);
$main_smarty->assign('number2', $number2);
$main_smarty->display($the_template . '/register_step_1.tpl');
}
This successfully makes the numbers visible. Now at the last step it should verify the sum of these two numbers:
if($_POST["addit"] != $mynumber) {
$main_smarty->display($the_template . '/register_error.tpl');
$error = true;
}
But it doesn't. It always fails.







Linear Mode




