Dateigrösse: 7.39 kb
1<html> <head> <title> G e g e n t e i l mit PHP by Mike Steiner</title> <link rel="stylesheet" href="scblack.css" type="text/css"> </head> <body> <?php if(isset($_POST['submit'])){ $loesung=array("klein","alt","langsam","gesund","sauber","interessant","viel","freundlich","teuer","dunkel","kalt","nass","glücklich","dick"); $s = "<img src=\"supersmile.gif\">"; $img = "<img src=\"red_x.gif\">"; $ok = false; foreach ($loesung as $key => $value) { if ($value == $_POST[$key]){ $ok[$key] = true; } } if (count($ok) != 1) { $a = count($ok); $c = count($loesung); $b = $c - $a; $a = ": ".$a." Einträge"; $b = ": ".$b." Einträge"; } }//isset schleife $monate = array("Dezember","Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"); $zeit = date("H:i"); $m = date("n"); $tag = date("j"); $jahr = date("Y"); $monat = $monate[$m]; ?> <table border="0" style="backgroundcolor:white" cellpadding="2" cellspacing="0" width="100%"> <tr height="30"> <td width="65%" colspan="2" style="color:#ffffff; padding-left:5px" style="backgroundcolor:#0099CC" height="30" align="left" valign="middle">Wie heisst das Gegenteil ???</td><td width="35%" valign="middle" style="color:#ffffff; padding-right:5px" style="backgroundcolor:#0099CC" height="30" align="right"><?php echo $tag.". ".$monat." ".$jahr." | ".$zeit." Uhr"; ?></td> </tr> </table> <table> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="gegenteil"> <tr height="10"><td colspan="2"></td></tr> <tr height="50"><td width="350" align="left"> gross # <input type="text" name="0" value="<?php if($ok[0] || $_POST[0]=='?') {echo $loesung[0];} else {echo $_POST[0];} ?>" size="9" /> <?php if($ok[0]) {echo $s;} else {if($_POST[0]=='?') {echo '';} else {echo $img;}} ?> </td> <td width="350" align="left"> jung # <input type="text" name="1" value="<?php if($ok[1] || $_POST[1]=='?') {echo $loesung[1];} else {echo $_POST[1];} ?>" size="9" /> <?php if($ok[1]) {echo $s;} else {if($_POST[1]=='?') {echo '';} else {echo $img;}} ?> </td></tr> <tr height="50"><td width="350" align="left"> schnell # <input type="text" name="2" value="<?php if($ok[2] || $_POST[2]=='?') {echo $loesung[2];} else {echo $_POST[2];} ?>" size="9" /> <?php if($ok[2]) {echo $s;} else {if($_POST[2]=='?') {echo '';} else {echo $img;}} ?> </td> <td width="350" align="left"> krank # <input type="text" name="3" value="<?php if($ok[3] || $_POST[3]=='?') {echo $loesung[3];} else {echo $_POST[3];} ?>" size="9" /> <?php if($ok[3]) {echo $s;} else {if($_POST[3]=='?') {echo '';} else {echo $img;}} ?> </td></tr> <tr height="50"><td width="350" align="left"> schmutzig # <input type="text" name="4" value="<?php if($ok[4] || $_POST[4]=='?') {echo $loesung[4];} else {echo $_POST[4];} ?>" size="9" /> <?php if($ok[4]) {echo $s;} else {if($_POST[4]=='?') {echo '';} else {echo $img;}} ?> </td> <td width="350" align="left"> langweilig # <input type="text" name="5" value="<?php if($ok[5] || $_POST[5]=='?') {echo $loesung[5];} else {echo $_POST[5];} ?>" size="9" /> <?php if($ok[5]) {echo $s;} else {if($_POST[5]=='?') {echo '';} else {echo $img;}} ?> </td></tr> <tr height="50"><td width="350" align="left"> wenig # <input type="text" name="6" value="<?php if($ok[6] || $_POST[6]=='?') {echo $loesung[6];} else {echo $_POST[6];} ?>" size="9" /> <?php if($ok[6]) {echo $s;} else {if($_POST[6]=='?') {echo '';} else {echo $img;}} ?> </td> <td width="350" align="left"> unfreundlich # <input type="text" name="7" value="<?php if($ok[7] || $_POST[7]=='?') {echo $loesung[7];} else {echo $_POST[7];}; ?>" size="9" /> <?php if($ok[7]) {echo $s;} else {if($_POST[7]=='?') {echo '';} else {echo $img;}} ?> </td></tr> <tr height="50"><td width="350" align="left"> billig # <input type="text" name="8" value="<?php if($ok[8] || $_POST[8]=='?') {echo $loesung[8];} else {echo $_POST[8];} ?>" size="9" /> <?php if($ok[8]) {echo $s;} else {if($_POST[8]=='?') {echo '';} else {echo $img;}} ?> </td> <td width="350" align="left"> hell # <input type="text" name="9" value="<?php if($ok[9] || $_POST[9]=='?') {echo $loesung[9];} else {echo $_POST[9];} ?>" size="9" /> <?php if($ok[9]) {echo $s;} else {if($_POST[9]=='?') {echo '';} else {echo $img;}} ?> </td></tr> <tr height="50"><td width="350" align="left"> warm # <input type="text" name="10" value="<?php if($ok[10] || $_POST[10]=='?') {echo $loesung[10];} else {echo $_POST[10];} ?>" size="9" /> <?php if($ok[10]) {echo $s;} else {if($_POST[10]=='?') {echo '';} else {echo $img;}} ?> </td> <td width="350" align="left"> trocken # <input type="text" name="11" value="<?php if($ok[11] || $_POST[11]=='?') {echo $loesung[11];} else {echo $_POST[11];} ?>" size="9" /> <?php if($ok[11]) {echo $s;} else {if($_POST[11]=='?') {echo '';} else {echo $img;}} ?> </td></tr> <tr height="50"><td width="350" align="left"> traurig # <input type="text" name="12" value="<?php if($ok[12] || $_POST[12]=='?') {echo $loesung[12];} else {echo $_POST[12];} ?>" size="9" /> <?php if($ok[12]) {echo $s;} else {if($_POST[12]=='?') {echo '';} else {echo $img;}} ?> </td> <td width="350" align="left"> dünn # <input type="text" name="13" value="<?php if($ok[13] || $_POST[13]=='?') {echo $loesung[13];} else {echo $_POST[13];} ?>" size="9" /> <?php if($ok[13]) {echo $s;} else {if($_POST[13]=='?') {echo '';} else {echo $img;}} ?> </td></tr> <tr height="1"><td colspan="2"></td></tr> </table> <hr><br> <table width="100%"> <tr height="30px"> <td width="25%" > <input title=" richtig oder falsch ??? - click hier " class="sub" type="submit" value="kontrollieren" name="submit" /> </form> </td> <td align="left" width="45%"><?php echo "<img src=\"supersmile.gif\">"; ?> richtig <?php echo $a; ?></td> <td width="30%"><p align="right"><a href="rb.php">nächste Übung</a> <img src='back_turnable.gif' width='25' height='25' alt='nächste Übung' border='0'></p></td> </tr> <tr height="50px"> <td> <!-- overLIB (c) Erik Bosrup (c) www.bosrup.com --> <script type="text/javascript" src="../js/overlib421/overlib.js"></script> <img onmouseover="return overlib('Du findest die richtige Antwort nicht? - Tippe ein \'?\' ins Feld ein und bestätige auf der Tastatur mit Enter oder klicke mit der Maus auf kontrollieren - Dann wird die Lösung angezeigt.', OFFSETX,10, OFFSETY,-50, CAPTION,'Probleme ???');" onmouseout="return nd();" src="icon_help_winxp.gif" alt="" width="26" height="26" border="0" align="left"> </td> <td align="left" width="10%"><?php echo "<img src=\"red_x.gif\">"; ?> falsch <?php echo $b; ?></td> <td> </td> </tr> </table> </body> </html>