<?php
if($_GET['action'] == "send")
{
if($_POST['number'] != md5($_POST['arithmetic']))
{
$err_text .="Die Rechenaufgabe wurde falsch gelöst!";
}
?>
<?php
$Zahl_1 = intval(rand(1, 5));
$Zahl_2 = intval(rand(1, 5));
?>
Wieviel ist <?php echo $Zahl_1; ?> plus <?php echo $Zahl_2; ?>?
<?php
echo'
<form method="post" action="'.$_SERVER["PHP_SELF"].'?'.$_SERVER['QUERY_STRING'].'">
<input name="number" type="hidden" id="number" value="<?php echo md5(( $Zahl_1 + $Zahl_2 )); ?>"/>
<input name="arithmetic" type="text" id="arithmetic"
style="width:250px" onfocus="if(this.value=='Das Ergebnis bitte hier
hinein...')this.value=''" onblur="if(this.value=='')this.value='Das
Ergebnis bitte hier hinein...'" value="Das Ergebnis bitte hier
hinein..."/>
<input type="submit" name="button" value="Absenden" class=rahmen>
</form>
');
?>
|